module (Products)

This module component fetches data relating to eCommerce Products and can be used to render Product information.

{% component type: "module", source: "Products", layout: "List" %}

Parameters and Options

Parameter Values Required Description
type module (default)
module_of_member

This is the name of the entity that needs to be used for the component retrieving function.

module is the standard retrieving function to retrieve all items.

module_of_member retrieves only those items "Added by" the currently logged in user (identified by the CreatedByMemberId property in the module items Liquid data).

The "Added by" System Property will only be available where the modules settings have "Allow Add New Items" turned on under the "Site User Permissions".

source Products (default) The entity/alias name or ID that the data is to be sourced from.
layout List (default)
<Your Layout name>

The layout name you want to use for rendering the component. The layout name is referenced from the available Layouts of the source specified.

While this parameter is required to render your Layout markup, if the parameter is blank, has an incorrectly referenced Layout, or is removed altogether then the component will still output the modules item data to a Liquid collection which can be accessed via the collectionVariable parameter.

filterBy id
parentid
name
weighting
url
urlslug
releasedate
expirydate
LastUpdatedDate
Author
ItemCategories
ItemTags
<CustomPropertyName>
...and any other top level properties available for the module

The name of the property to filter by. If empty or not present, no filtering will be used.

Remove spaces from custom property names here.

filterValue <your value>
Your specific value to filter by, eg: name, id, number, date, etc.
Liquid variables can be used here also. If present but no value set, no items will be returned.
sortBy id
parentid
name
weighting
url
urlslug
releasedate
expirydate
LastUpdatedDate
Author
ItemCategories
ItemTags
<CustomPropertyName>
...and any other top level properties available for the module

The name of the property to sort by. If empty or not present, alpha/numeric sorting will be used.

Remove spaces from custom property names here.

sortOrder ASC (default)
DESC

ASC sorts the items in ascending order while DESC sorts in descending order (based on alpha/numeric or date sorting).
If empty or not present, alpha/numeric sorting will be used.
random false (default)
true

Displays the available items in a random order.

If used in conjunction with sortBy, that sorting criteria will be applied to the randomly retrieved results. So, if retrieving all, or most, of the items they will not appear to be random since they will then be sorted back into a logical order. To overcome this, set the sortBy parameter to 'enabled' (or another unused property) as this will not provide any viable sorting criteria* and the items will not be sorted from their initial random order.
* Unless there are weighted items, which will always override the random option.

limit 10 (default)
<number>

The maximum number of items returned. If displayPagination is enabled this determines the maximum number of items per page.
enablePagination true (default)
false

Enables/disables pagination for the component.

This is useful for avoiding pagniation affects for a specific component when multiple components of the same module are output on the same page and do use pagination.

displayPagination false (default)
true

Displays pagination if there are more items available than the limit set.
emptyMessage <Your custom message>
Custom content that is rendered if no items are returned by the Component. The default is no content.
Liquid variables are supported here, although Liquid logic tags and HTML are not.

If using Liquid variables with filters added, be sure to change any double quotes to single quotes. For eg:
emptyMessage: “{{ myVariable | prepend: 'Error: ' }}”

To use HTML in your empty message, first capture it using a Liquid capture, then insert the capture variable into the emptyMessage parameter.

object item (default)
collection

Determines the method for Liquid rendering.
item returns each item iteratively, one after another, for output (generally, output to a container element with no need for looping through the data).
collection returns all items as one collection for output (your container element and looping logic would be handled in the Components Layout).
collectionVariable <yourLiquidVariableName>
Assigns the data to a Liquid collection enabling further access to the data on the Page or Template using Liquid.

Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

isSearchResult false (default)
true

Allows search parameters in the URL to override the components output. Therefore, this parameter can be used to output module specific search results from a submitted search form.

Likewise, Tag, Category, and Archive components can be used in conjunction with this parameter for filtering the module's output.

URL search parameters will override any corresponding parameters in the component. If no search parameters are present in the URL, isSearchResult will be ignored.

Any value other than true, (including an empty value), will disable the search functionality and the component will output its regular data.

<customParameter> <your custom value>
You can add your own additional parameters (name/value pairs) to the Component tag. These will be passed to the Components Layout (and the collectionVariable if used) for use via Liquid.

Your <customParameter> name must only contain English letters, numbers or underscores. Spaces or special characters are not supported.

You can use HTML as the value here, just be sure to change any double quotes in your HTML to single quotes.

Liquid Output

The below example has 3 sample items but is otherwise the default structure you will get from this Component.

{
  "Pagination": {
  "CurrentPage": 1,
  "ItemsPerPage": 10,
  "NumberOfPages": 1,
  "TotalItemsCount": 3
},
  "Items": [
  {
    "Id": 2535,
    "Url": "/catalogs/demo-product-1",
    "ParentId": 2489,
    "LastUpdatedDate": "2020-05-20T09:35:15",
    "Name": "DEMO Product 1",
    "UrlSlug": "demo-product-1",
    "Enabled": true,
    "ReleaseDate": "2020-05-05T00:00:00",
    "ExpiryDate": "2099-12-11T13:00:00",
    "Weighting": 0,
    "Description": "<p>Sample product 1 for the ecommerce store.</p>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": false,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "0.5",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "DEMO1",
    "SiteSearchKeywords": "",
    "SmallImage": "/images/template-detail-dinewine-mobile@2x.png",
    "LargeImage": "/images/template-detail-dinewine-desktop@2x.jpg",
    "OnSale": false,
    "IsGiftVoucher": false,
    "ProductWeight": 0,
    "ProductWidth": 0,
    "ProductHeight": 0,
    "ProductDepth": 0,
    "EnableDropShipping": false,
    "Supplier": "0",
    "UnitType": "",
    "MinimumUnits": 0,
    "MaximumUnits": 0,
    "RecurringType": "",
    "IsShippable": true,
    "IsDownloadable": false,
    "DownloadableFileLink": "",
    "NumberOfPossibleDownloads": 0,
    "Module_ID": 2485,
    "Module_Alias": "Product",
    "taxRate": 0.0400,
    "Price": 39.9500,
    "IsHide": false,
    "InStock": 0,
    "IsDisable": false,
    "priceWithTax": 41.54800000,
    "ProductDataJSON": {
      "itemId": 2535,
      "attributes": {
        "12462596046050033665": {
          "id": "12462596046050033665",
          "isInventory": true,
          "name": "Size",
          "type": 2,
          "required": true,
          "optionIds": [
            "16234894512508370945",
            "16234894512508370946",
            "16234894512508370947"
          ]
        }
      },
      "variations": null,
      "options": {
        "16234894512508370945": {
          "id": "16234894512508370945",
          "attributeId": "12462596046050033665",
          "name": "Small",
          "image": "/images/template-detail-crafter-mobile.png",
          "price": 0.0000
        },
        "16234894512508370946": {
          "id": "16234894512508370946",
          "attributeId": "12462596046050033665",
          "name": "Medium",
          "image": "/images/template-crafter@2x.jpg",
          "price": 2.0000
        },
        "16234894512508370947": {
          "id": "16234894512508370947",
          "attributeId": "12462596046050033665",
          "name": "Large",
          "image": "/images/template-detail-crafter-desktop@2x.jpg",
          "price": 4.0000
        }
      },
      "inStockTotal": null,
      "recommendedPrice": 49.9500,
      "prices": {
        "0": 39.9500
      },
      "taxInPercent": 4.0000,
      "taxRate": 0.0400,
      "enablePreOrder": true,
      "maximumUnits": 0,
      "minimumUnits": 0,
      "QuantityThreshold": [
        {
          "Quantity": 0,
          "Price": 39.9500
        }
      ]
    },
    "RecommendedPrice": 49.9500,
    "EnableInventoryControl": false,
    "VolumeDiscount": [
      {
        "Quantity": 0,
        "Price": 39.9500
      }
    ],
    "PriceHtml": "<span data-cms_product_data_price=\"2535\">39.95</span>",
    "InStockHtml": "<span data-cms_product_data_in_stock=\"2535\">0</span>",
    "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2535\">41.55</span>",
    "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2535\">49.95</span>",
    "InventoryProductVariations": [
      {
        "SKUCode": "DEMO1",
        "InStock": 0,
        "PreOrder": 0
      }
    ],
    "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2535,{\"itemId\":2535,\"attributes\":{\"12462596046050033665\":{\"id\":\"12462596046050033665\",\"isInventory\":true,\"name\":\"Size\",\"type\":2,\"required\":true,\"optionIds\":[\"16234894512508370945\",\"16234894512508370946\",\"16234894512508370947\"]}},\"variations\":null,\"options\":{\"16234894512508370945\":{\"id\":\"16234894512508370945\",\"attributeId\":\"12462596046050033665\",\"name\":\"Small\",\"image\":\"/images/template-detail-crafter-mobile.png\",\"price\":0.0000},\"16234894512508370946\":{\"id\":\"16234894512508370946\",\"attributeId\":\"12462596046050033665\",\"name\":\"Medium\",\"image\":\"/images/template-crafter@2x.jpg\",\"price\":2.0000},\"16234894512508370947\":{\"id\":\"16234894512508370947\",\"attributeId\":\"12462596046050033665\",\"name\":\"Large\",\"image\":\"/images/template-detail-crafter-desktop@2x.jpg\",\"price\":4.0000}},\"inStockTotal\":null,\"recommendedPrice\":49.9500,\"prices\":{\"0\":39.9500},\"taxInPercent\":4.0000,\"taxRate\":0.0400,\"enablePreOrder\":true,\"maximumUnits\":0,\"minimumUnits\":0,\"QuantityThreshold\":[{\"Quantity\":0,\"Price\":39.9500}]});</script>"
  },
  {
    "Id": 2536,
    "Url": "/catalogs/demo-product-2",
    "ParentId": 2489,
    "LastUpdatedDate": "2020-05-20T09:35:14",
    "Name": "DEMO product 2",
    "UrlSlug": "demo-product-2",
    "Enabled": true,
    "ReleaseDate": "2020-05-06T00:00:00",
    "ExpiryDate": "2099-12-11T13:00:00",
    "Weighting": 0,
    "Description": "<p>Sample product for the ecommerce store.</p>",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": false,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "0.5",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "DEMO2",
    "SiteSearchKeywords": "",
    "SmallImage": "/images/template-detail-crafter-mobile@2x.png",
    "LargeImage": "/images/template-detail-crafter-desktop@2x.jpg",
    "OnSale": false,
    "IsGiftVoucher": false,
    "ProductWeight": 0,
    "ProductWidth": 0,
    "ProductHeight": 0,
    "ProductDepth": 0,
    "EnableDropShipping": false,
    "Supplier": "0",
    "UnitType": "",
    "MinimumUnits": 0,
    "MaximumUnits": 0,
    "RecurringType": "",
    "IsShippable": true,
    "IsDownloadable": false,
    "DownloadableFileLink": "",
    "NumberOfPossibleDownloads": 0,
    "Module_ID": 2485,
    "Module_Alias": "Product",
    "taxRate": 0.0,
    "Price": 0.0,
    "IsHide": false,
    "InStock": 0,
    "IsDisable": false,
    "priceWithTax": 0.0,
    "ProductDataJSON": {
      "itemId": 2536,
      "attributes": {},
      "variations": null,
      "options": {},
      "inStockTotal": null,
      "recommendedPrice": null,
      "prices": {
        "0": 0.0
      },
      "taxInPercent": 0.0,
      "taxRate": 0.0,
      "enablePreOrder": true,
      "maximumUnits": 0,
      "minimumUnits": 0,
      "QuantityThreshold": [
        {
          "Quantity": 0,
          "Price": 0.0
        }
      ]
    },
    "RecommendedPrice": 0.0,
    "EnableInventoryControl": false,
    "VolumeDiscount": [
      {
        "Quantity": 0,
        "Price": 0.0
      }
    ],
    "PriceHtml": "<span data-cms_product_data_price=\"2536\">0.00</span>",
    "InStockHtml": "<span data-cms_product_data_in_stock=\"2536\">0</span>",
    "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2536\">0.00</span>",
    "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2536\">0.00</span>",
    "InventoryProductVariations": [
      {
        "SKUCode": "DEMO2",
        "InStock": 0,
        "PreOrder": 0
      }
    ],
    "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2536,{\"itemId\":2536,\"attributes\":{},\"variations\":null,\"options\":{},\"inStockTotal\":null,\"recommendedPrice\":null,\"prices\":{\"0\":0.0},\"taxInPercent\":0.0,\"taxRate\":0.0,\"enablePreOrder\":true,\"maximumUnits\":0,\"minimumUnits\":0,\"QuantityThreshold\":[{\"Quantity\":0,\"Price\":0.0}]});</script>"
  },
  {
    "Id": 2563,
    "Url": "/catalogs/demo-product-3",
    "ParentId": 2489,
    "LastUpdatedDate": "2020-05-20T09:35:16",
    "Name": "DEMO Product 3",
    "UrlSlug": "demo-product-3",
    "Enabled": true,
    "ReleaseDate": "2020-05-20T00:00:00",
    "ExpiryDate": "2099-12-11T13:00:00",
    "Weighting": 0,
    "Description": "",
    "ItemTags": null,
    "Author_Name": null,
    "Author_Url": null,
    "Author": "",
    "SEOTitle": "",
    "MetaTitle": "",
    "MetaDescription": "",
    "ShowPageForSearchEngine": false,
    "CanonicalLink": "",
    "EnableAMP": false,
    "AMPContent": "",
    "CodeEditor": false,
    "ExternalId": 0,
    "SocialMetaTags": "",
    "OpenGraphProperties": "",
    "DisableForSiteSearch": false,
    "SeoPriority": "0.5",
    "CreatedByMemberId": 0,
    "ItemCategories": null,
    "ItemCategoryIdList": null,
    "SKUCode": "7067ce22-6b5d-4bdb-80e6-b878ca0b31f2",
    "SiteSearchKeywords": "",
    "SmallImage": null,
    "LargeImage": null,
    "OnSale": false,
    "IsGiftVoucher": false,
    "ProductWeight": 0,
    "ProductWidth": 0,
    "ProductHeight": 0,
    "ProductDepth": 0,
    "EnableDropShipping": false,
    "Supplier": "0",
    "UnitType": "",
    "MinimumUnits": 0,
    "MaximumUnits": 0,
    "RecurringType": "",
    "IsShippable": true,
    "IsDownloadable": false,
    "DownloadableFileLink": "",
    "NumberOfPossibleDownloads": 0,
    "Module_ID": 2485,
    "Module_Alias": "Product",
    "taxRate": 0.0,
    "Price": 0.0,
    "IsHide": false,
    "InStock": 0,
    "IsDisable": false,
    "priceWithTax": 0.0,
    "ProductDataJSON": {
      "itemId": 2563,
      "attributes": {},
      "variations": null,
      "options": {},
      "inStockTotal": null,
      "recommendedPrice": null,
      "prices": {
        "0": 0.0
      },
      "taxInPercent": 0.0,
      "taxRate": 0.0,
      "enablePreOrder": true,
      "maximumUnits": 0,
      "minimumUnits": 0,
      "QuantityThreshold": [
        {
          "Quantity": 0,
          "Price": 0.0
        }
      ]
    },
    "RecommendedPrice": 0.0,
    "EnableInventoryControl": false,
    "VolumeDiscount": [
      {
        "Quantity": 0,
        "Price": 0.0
      }
    ],
    "PriceHtml": "<span data-cms_product_data_price=\"2563\">0.00</span>",
    "InStockHtml": "<span data-cms_product_data_in_stock=\"2563\">0</span>",
    "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2563\">0.00</span>",
    "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2563\">0.00</span>",
    "InventoryProductVariations": [
      {
        "SKUCode": "7067ce22-6b5d-4bdb-80e6-b878ca0b31f2",
        "InStock": 0,
        "PreOrder": 0
      }
    ],
    "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2563,{\"itemId\":2563,\"attributes\":{},\"variations\":null,\"options\":{},\"inStockTotal\":null,\"recommendedPrice\":null,\"prices\":{\"0\":0.0},\"taxInPercent\":0.0,\"taxRate\":0.0,\"enablePreOrder\":true,\"maximumUnits\":0,\"minimumUnits\":0,\"QuantityThreshold\":[{\"Quantity\":0,\"Price\":0.0}]});</script>"
  }
],
  "Params": {},
  "Parent": {
  "Id": 2549,
  "Url": "/component-types/module-products",
  "ParentId": 2127,
  "LastUpdatedDate": "2020-05-20T00:51:09",
  "Name": "module (Products)",
  "UrlSlug": "module-products",
  "Enabled": true,
  "ReleaseDate": "2018-09-04T00:00:00",
  "ExpiryDate": "2099-12-09T00:00:00",
  "Weighting": 893,
  "Description": "\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n\r\n{% component type: \"snippet\", alias: \"section_parameters\" %}\r\n\r\n{% component type: \"snippet\", alias: \"param_table_head\" %}\r\n    {% component type: \"snippet\", alias: \"param_type\", required: \"true\", values: \"module <em>(default)</em>,module_of_member\" %}\r\n    {% component type: \"snippet\", alias: \"param_source\", required: \"true\", values: \"Products <em>(default)</em>\" %}\r\n    {% component type: \"snippet\", alias: \"param_layout\", required: \"true\", values: \"List <em>(default)</em><br>&lt;Your Layout name&gt;\" %}\r\n    {% component type: \"snippet\", alias: \"param_filterby\" %}\r\n    {% component type: \"snippet\", alias: \"param_filtervalue\" %}\r\n    {% component type: \"snippet\", alias: \"param_sortby\" %}\r\n    {% component type: \"snippet\", alias: \"param_sortorder\" %}\r\n    {% component type: \"snippet\", alias: \"param_random\" %}\r\n    {% component type: \"snippet\", alias: \"param_limit\" %}\r\n    {% component type: \"snippet\", alias: \"param_enablepagination\" %}\r\n    {% component type: \"snippet\", alias: \"param_displaypagination\" %}\r\n    {% component type: \"snippet\", alias: \"param_emptymessage\" %}\r\n    {% component type: \"snippet\", alias: \"param_object\" %}\r\n    {% component type: \"snippet\", alias: \"param_collectionvariable\" %}\r\n    {% component type: \"snippet\", alias: \"param_issearchresult\" %}\r\n    \r\n    {% component type: \"snippet\", alias: \"param_customparameter\" %}\r\n{% component type: \"snippet\", alias: \"param_table_foot\" %}\r\n\r\n\r\n{% component type: \"snippet\", alias: \"section_output\" %}\r\n\r\n{% component source: \"Products\", layout: "", type: \"module\", collectionVariable: \"allProducts\" %}\r\n<p>The below example has 3 sample <code>items</code> but is otherwise the default structure you will get from this Component.</p>\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{allProducts}}\", lang: \"json\" %}\r\n\r\n{% component type: \"snippet\", alias: \"section_accessing_data\" %}\r\n\r\n<p>This data is accessible in two main ways:</p>\r\n\r\n<p>1. Using Liquid in the specified Layout via the <code>this</code> object.</p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n<p>2. Directly on the Page or Template via a Liquid Collection if <code>collectionVariable</code> was added to the Component tag.</p>\r\n\r\n<p>An example using <code>collectionVariable</code> with value \"allProducts\" to list all \"Productss\" across the site:</p>\r\n<p class=\"notice-note\">Here we suppress any Layout from rendering by setting <code>layout: \"\"</code> as an empty attribute.</p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n<p><em>Looping through the collection to render all the item URLs in a list, giving us:</em></p>\r\n\r\n<ul>\r\n    \r\n        <li>/catalogs/demo-product-1</li>\r\n    \r\n        <li>/catalogs/demo-product-2</li>\r\n    \r\n        <li>/catalogs/demo-product-3</li>\r\n    \r\n</ul>\r\n<br>\r\n<p><em>The code:</em></p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n<p><em>Accessing a specific item within the collection. In this case the second item (zero based index), which in our example would render the value <code>/catalogs/demo-product-2</code></em></p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n\r\n{% component type: \"snippet\", alias: \"section_counter\" %}\r\n",
  "ItemTags": [
  "Ecommerce"
],
  "Author_Name": "",
  "Author_Url": "",
  "Author": "",
  "SEOTitle": "",
  "MetaTitle": "",
  "MetaDescription": "This module component fetches data relating to eCommerce Products and can be used to render Product information.",
  "ShowPageForSearchEngine": true,
  "CanonicalLink": "",
  "EnableAMP": false,
  "AMPContent": "",
  "CodeEditor": true,
  "ExternalId": 0,
  "SocialMetaTags": "",
  "OpenGraphProperties": {
  "title": "",
  "type": "",
  "url": "",
  "locale": "",
  "image": ""
},
  "DisableForSiteSearch": false,
  "SeoPriority": "0.8",
  "CreatedByMemberId": 0,
  "ItemCategories": "",
  "ItemCategoryIdList": "",
  "SKUCode": "",
  "SiteSearchKeywords": "",
  "Active": true,
  "IgnoreUpdates": false,
  "UpdateNotes": "All new article",
  "UpdatesLog": "",
  "ExternalResources": "",
  "AdditionalRelatedArticle_Name": "",
  "AdditionalRelatedArticle_Url": "",
  "AdditionalRelatedArticle": "",
  "AdditionalRelatedArticle2_Name": "",
  "AdditionalRelatedArticle2_Url": "",
  "AdditionalRelatedArticle2": "",
  "Authors": "2418",
  "Module_ID": 1870,
  "Module_Alias": "DocumentationPost",
  "ParentName": "Liquid Components",
  "ParentUrl": "/component-types",
  "TemplateName": "Docs Template",
  "IsHome": false
}
}

Accessing the Data

This data is accessible in two main ways:

1. Using Liquid in the specified Layout via the this object.

{{this['url']}}

2. Directly on the Page or Template via a Liquid Collection if collectionVariable was added to the Component tag.

An example using collectionVariable with value "allProducts" to list all "Productss" across the site:

Here we suppress any Layout from rendering by setting layout: "" as an empty attribute.

{% component type: "module", source: "Products", layout: "", collectionVariable: "allProducts" %}

Looping through the collection to render all the item URLs in a list, giving us:

  • /catalogs/demo-product-1
  • /catalogs/demo-product-2
  • /catalogs/demo-product-3

The code:

<ul>
    {% for i in allProducts.items %}
        <li>{{i['url']}}</li>
    {% endfor %}
</ul>

Accessing a specific item within the collection. In this case the second item (zero based index), which in our example would render the value /catalogs/demo-product-2

{{allProducts.items[1]['url']}}

Counter

Along with the data output above, there is also a special liquid tag available {{counter}} which increments for each item. This tag is only available within Layouts when object: "item" is used in the Component tag.



Related Articles

  • Domains
    The Treepl CMS Domain settings allow you to control default domain, landing pages, domain authentication for system emails along with country and cultural settings like number and currency formatting.
  • Payment Settings
  • Orders
  • Advanced CRM Groups
  • {{ order }} object
    This liquid object will output the order details of a submitted payment. {% capture data...
  • module (Catalogs)
    This module component fetches data relating to eCommerce Catalogs and can be used to render Catalog structures and Products within them.
  • ecommerce_add_to_cart
    This component renders an anchor element allowing the javascript function to add the item to the shopping cart.
  • ecommerce_buy_now
    This component renders an anchor element allowing the javascript function to add the item to the shopping cart and then proceeding directly to the shopping cart page.
  • ecommerce_item_quantity
    This component renders a form input element allowing a quantity to be set for when the source item is added to the shopping cart.
  • item_attributes
    This component fetches all attributes/options for a specified product. By default, each attribute group is rendered, with its options and any prices, according to their specified form inputs.
  • related_items
    This component fetches related items of a specific source item, such as a Product that has had Related Products assign to it.
  • grouped_items
    This component fetches grouped items of a specific source item, such as a Product that has been Grouped with other Products and allows the ability to navigate between grouped items.
  • currencies
    This component renders a form select element of all currency names, codes and symbols by default, and can also be used to output currency data to a Liquid collection.
  • shopping_cart
    This component fetches data relating to the shopping cart, such as any products added, order totals, tax, shipping, etc.
  • shipping_options
    This component renders a form select element of all shipping options configured on the site, and can also be used to output shipping option data to a Liquid collection.
  • shippingProvidesFields
  • tax_codes
    This component renders a form select element of all tax codes configured on the site, and can also be used to output tax code data to a Liquid collection.
  • payment_form_fields
    This component is used to render payment fields, and payment related validation errors, within a form using the capabilities provided by your configured payment gateway.
  • orders
    This component fetches Orders from the CRM, either owned by the logged-in user or for all customer Orders.
  • Getting Started
    With the recent release of eCommerce features there are some advanced system components that are...
  • Products
    Products are one of the most powerful and flexible modules in Treepl CMS. Create customised product schemas with multiple price points, catalogs, inventory tracked attributes/variables, SEO optimisation and more.
  • Catalogs
    When organising any eCommerce store, Catalogs are crucial to your Products structure and browserbility. Easily create and customise unlimited product catalogs for your online store.
  • Discount codes
    Provide discount code functionality for your Treepl CMS shopping cart. Ideal for promotions, customer loyalty and conversions or to help move more stock.
  • Gift vouchers
    Gift vouchers can be issued to your customers or purchased by them online via the shopping cart.
  • Taxes
    Create any number of required tax codes specific to the shipping country selected in your Treepl CMS shopping cart.
  • countries
    This component renders a form select element of all country names and country codes by default, and can also be used to output country codes/names to a Liquid collection.
  • domain_settings
    This module component retrieves settings associated with the current domain, or optionally from another specified domain configured in the site instance.
  • Shipping options
    Treepl CMS provides the ability to configure custom shipping options based on a variety of conditions during the shopping cart stage.
  • Settings
  • Migrating to Advanced Payment Flow
    This article describes differences and possible required actions for migrating to the Advanced Payment Gateway flow.

External Resources

There are currently no external resources available.

Please let us know if you have any other contributions or know of any helpful resources you'd like to see added here.


Questions?

We are always happy to help with any questions you may have.
Visit the Treepl Forum for community support and to search previously asked questions or send us a message at support@treepl.co and we will consult you as soon as possible.