Catalog Machine provides expressions for iterating and formatting your product data that you can use in your layouts, templates and catalog pages.

Read more and see practical examples in how to customize product and price layouts.

Expression groups

  1. Catalog
  2. Products
  3. Categories / Collections
  4. Variants
  5. Images
  6. Condition operators
  7. Sort, limit and unique operators
  8. Conditional text (If..Else...)
  9. Expressions in HTML
  10. PDF page break

Note: All expressions are enclosed in double brackets – {{…}} ( e.g. {{Price}})- pay attention not to break them by formatting text!

1. Catalog expressions

Most of these expressions can be used inside a catalog page. templates, header or footer

  • {{Current Date}} - current timestamp on the server (UTC time)
    Use custom formatting, e.g. {{Current Date:MMMM dd, yyyy}}, where
    MM, MMM, MMMM - month (digits, short, full), d, dd, ddd, dddd (day, week), yy, yyyy - year

Any text expression can use character limit. For example

  • {{Description:50}} or {{Name: 20}} that will produce text my description... if it exceeds the limit


  • Use {{BarcodeImage}} or {{BarcodeImageExt}} to display a barcode image, if the field name is different (e.g. MyField) use {{BarcodeImage:MyField}} or {{BarcodeImageExt:MyField}}
  • BarcodeImageExt - display image with a code text below
  • You can use barcode image with a code directly {{BarcodeImageExt:89567894}}

2. Products

Products have built-in fields (e.g. Name, Code, etc.) and custom fields defined by you on the category level (e.g. Price, Image, Retail Price, Shop Link, etc.).

Usage: These fields could be used in and product text box or inside product iterator.
Example :
{{Name}} {{Description}}
{{Products}} {{Name}} - {{Price}} {{/Products}}

Product built-in  and standard fields:

  • Code
  • Name
  • Category
  • Rank – also used in showroom for ordering
  • Modified – date product last modified
  • VariantCount – number of product variants
  • Image
  • Description
  • Price
  • Category and collection fields - Category.Name, Collection.Description, etc. (see the following section)

Product iterator: {{Products:condition operators}}content…{{/Products}}

{{Products: Category = Shoes : Price > 0 : Order By > Code }}
{{Name}} - {{Description}} - ${{Price}}

See more examples in How to customize product and price layouts.

3. Categories / Collection

Usage: Category and collection fields can be used inside category iterator or  product text

Category / Collection fields:

  • Name
  • FullName – includes parent name if exists
  • Description
  • Color
  • Parent –  parent collection  / category
  • ProductCount – number of products in this category
  • FullProductCount – number of products in this and child category
  • Thumbnail – category thumbnail image

Product text box

{{Category.Name}} same as {{Category}}

Category iterator: {{Categories:condition operators}}content…{{/Categories}}

{{Categories: ProductCount > 0}}
{{Thumbnail:Fit:50:50}}  {{Name}} ({{ProductCount}}) {{Description}}

{{Categories: Parent = Clothing}}{{Name}}{{Products}}{{Name}} - ${{Price}}{{/Products}}{{/Categories}}

See more examples in How to customize product and price layouts.

4. Variants

Variants have built-in fields and configured on category level options (e.g. Color, Size). You can reference options by name or index – Color or Option:1 (same as Option), Size or Option:2.

Usage: These fields could be used only inside the variant iterator.
Example :
{{Variants}} {{SKU}} {{Option:1}} / {{Option:2}} - {{Price}} {{/Variants}}
{{Variants}} {{SKU}} {{Color}}/{{Size}} - {{Price}} {{/Variants}}

Variant fields:

  • SKU
  • Price
  • Description
  • Image
  • Description
  • Price
  • Barcode
  • BarcodeImage or BarcodeImageExt - a barcode image based on Barcode field
  • Quantity
  • Separator – used to separate iterated variants
  • Product.Field - reference containing product fields (e.g. {{Product.Price}})

Variant iterator: {{Variants:condition operators}}content…{{/Variants}}

{{Products: VariantCount > 0}}

{{Variants:OrderBy > SKU}}
{{SKU}} - {{Option}}{{Separator:,}}
Barcode: {{Barcode}}
Quantity: {{Quantity}}
Variant Price: {{Price}}
Original Price: {{Product.Price}}

See more examples in How to customize product and price layouts.

5. Images

Image fields (product, variants, category thumbnail) could have additional parameters – positioning, width, and height to align with rest of text.

Format: {{Image:Position:Width:Height}}

Position could be  Fit, Fill, Stretch,Center,Default

{{Image}} - automatically sized
{{Image:Fit:200:100}} - sized to fit into box 200 x 100 pixels

6. Condition Operators

These are condition operators you can use in any iterator or {{If}}


  • ~ contains as sub string: {{Products:Description ~ Sale}}
  • = – text is equal {{Products: Category = Shoes}}
  • <> – text is not equal {{Products: Category <> Shoes}}
  • <,<=,>,>= – compare numbers (or text in alphabetical order){{Products: Price > = 10 : Price <= 100}}{{Categories: ProductCount > 0}} 
  • ! in front of condition makes it negative {{Products: !Description~Sale}}

7. Sort, limit and unique operators

These expression can be used in any iterator. You can also use them in paging scenario

  • OrderBy – sort by descending (>) or ascending order (<)
    {{Products: OrderBy > Price}} – price in descending order
    {{Products: OrderBy < Price}} – price in ascending order
  • LimitBy – take only limited number of items
    {{Products: LimitBy = 50 }} – first 50 products
    {{Products: LimitBy = 10 : OrderBy > Price}} – top 10 products by price
  • SkipBy – skip first number of items
    {{Products: SkipBy = 10 }} – skip first 10 products
    {{Products: Category = Shoes : SkipBy = 20: LimitBy = 10 : OrderBy > Code }} – skip first 20 products  and show next 10 products in category Shoes ordered by Code
  • Unique - display only unique values from the list Unique = [Field Name]
    {{Products: VariantCount > 0}}
    {{Variants: Unique=Color}}{{Color}}{{/Variants}}

8. Conditional text

Use {{If condition}}…{{/If}} to show text if condition is true. You can use extended version {{If...}}...yes...{{Else}}{{/If}}

{{If Price > 100}} High price {{Else}} Low price {{/If}}
{{If Tag~sale}} Sale: {{Sale Price}} {{/If}}

Check empty fields:
{{If Price}} Price: {{Price}} {{/If}}

For negative condition put ! before expression
{{If !Price}} No price {{/If}}
{{If !Description}}{{Category.Description}}{{/If}}


Or combine both outcomes with {{Else}}:
{{If Price > 0 }} Price: {{Price}} {{Else}} No price {{/If}}}
{{If Description}}{{Description}}{{Else}}{{Category.Description}}{{/If}}

You can use it inside any iterator

{{Products}} {{Name}} - {{If Price=0}} N/A {{/If}} {{If Price>0}} ${{Price}} {{/If}} {{/Products}}

9. Expressions in HTML code

Expressions can be used inside text box HTML (switch with code button). Please switch back after to store your HTML changes.

<span style="color:{{Collection.Color}};">{{Name}}</span>

<span style="color:{{If Collection.Color}}{{Collection.Color}}{{Else}}#efefef{{/If}};">{{Name}}</span>


10. PDF Page Break

You can put a page break anywhere in HTML, that will force PDF to break a page. 

<!-- pagebreak -->

It could be useful in expandable elements, e.g. at the end of category section 

Did this answer your question?