Overview
TemplateMark provides powerful list iteration capabilities to render arrays of data. You can create both ordered and unordered lists, as well as format list items with localization support.List Types
Unordered Lists
Create bulleted lists using the{{#ulist}} block:
Ordered Lists
Create numbered lists using the{{#olist}} block:
Basic List Example
The this Keyword
Within a list block, {{this}} refers to the current item being iterated:
For simple arrays (strings, numbers), use
{{this}} to access the value. For arrays of objects, access properties directly.Iterating Object Arrays
When iterating over arrays of objects, access object properties directly:Example with Object Array
Join Lists
The{{#join}} block formats arrays into natural language lists with localization support:
Join Parameters
Language locale (e.g.,
en, en-GB, fr, de)List style:
long, short, or narrowList type:
conjunction (and), disjunction (or), or unitJoin Examples
Localized Lists
Join supports multiple locales for international documents:- English (US)
- English (UK)
- French
- German
CAR, ACCESSORIES, and SPARE_PARTSComplex List Patterns
Nested Lists
Create nested list structures:Lists with Formulas
Combine lists with formula expressions:Conditional List Items
Use formulas for conditional rendering:Empty Lists
Handle empty arrays gracefully:List blocks render nothing if the array is empty. Use conditional clauses to show fallback content.
Advanced Examples
Shopping Cart
Attendee List
Best Practices
Choose the right list type
Choose the right list type
Use ordered lists for sequences, unordered for collections:
Use join for natural language
Use join for natural language
For prose, prefer join over lists:
Validate array existence
Validate array existence
Check arrays exist before iteration:
Specify locale for join
Specify locale for join
Always set locale for consistent formatting:
Related Topics
Variables
Access and format variables within lists
Conditionals
Add conditional logic to list rendering
Formulas
Use formulas for calculated list values