Example 2: Display the List of Product Categories Using Nested Template Parameters

The example below demonstrates how to display the list of product categories using nested template parameters:

<ul>
 <!--{foreach $.categories as category}-->
   <li>
       <a href="<!--{= category.link }-->"><!--{= category.title }-->(<!--{= category.count }-->)</a>
   </li>
 <!--{/foreach}-->
</ul>
Attribute Description
categories the list of HTML nodes declared in template parameters andaccessed using the $ object
link , title , and count template parameters specified by XPath within categories and accessed through the item object declared here as category