Change log

module (Catalogs)

This module component fetches data relating to eCommerce Catalogs and can be used to render Catalog structures and Products within them.

{% component type: "module", source: "Catalogs", 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
Catalogs (default)
The module’s 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.
ignoreWeighting
false (default)
true

Enables/disables sorting items first by their weighting values. When false items will sort by their weighting values first, followed by any sortBy properties (or the default alpha/numeric sorting if sortBy is empty or not present). If true item weightings will be ignored and sorting will only be applied via sortBy or default sorting.
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.

If this param's value is 'true' - pagination will not be shown.
limit
10 (default)
<integer>

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.

searchScope
eg:
{'prop_ParentId':'1234', 'prop_ReleaseDate_Min':'2018-07-01', 'prop_ReleaseDate_Max':'2018-07-31', 'prop_KeyWords':'Your Keywords', 'prop_ItemTags':['tag1','tag2'], 'page':'2'}

Allows a search on the module without search parameters needed in the URL. Instead, search parameters are added to the value of this parameter. Therefore, this parameter can be used to output module specific search results from hard-coded (or Liquid) values without the use of a search form.

Added search parameters will override any corresponding parameters otherwise configured on the component. If no search parameters are present, searchScope will be ignored.

This value supports Liquid and can therefore be constructed with Liquid data/variables.

<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.

Also, see here for a tutorial on using Custom Paramters.

Liquid Output

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

{
  "Params": {
    "source": "Catalogs",
    "layout": "",
    "type": "module",
    "collectionvariable": "allCatalogs"
  },
  "Pagination": {
    "CurrentPage": 1,
    "ItemsPerPage": 10,
    "NumberOfPages": 1,
    "TotalItemsCount": 2
  },
  "Parent": {
    "Id": 2545,
    "Name": "module (Catalogs)",
    "Url": "/component-types/module-catalogs",
    "Url_List": [
      "/component-types/module-catalogs"
    ],
    "UrlSlug": "module-catalogs",
    "ParentId": 2127,
    "ParentId_List": [
      2127
    ],
    "ParentName": "Liquid Components",
    "ParentUrl": "/component-types",
    "TemplateName": "Docs Template",
    "Module_Alias": "DocumentationPost",
    "Module_ID": 1870,
    "Enabled": true,
    "ReleaseDate": "2018-09-03T23:00:00",
    "ExpiryDate": "2099-12-09T00:00:00",
    "SiteSearchKeywords": [],
    "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: \"json\", source_type:\"string\", source:\"{{tabularData}}\", layout:\"/snippets/tabularJSON.layout\" %}\r\n</section>\r\n\r\n{% component type: \"snippet\", alias: \"section_output\" %}\r\n\r\n{% component source: \"Catalogs\", layout: "", type: \"module\", collectionVariable: \"allCatalogs\" %}\r\n<p>The below example has 2 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: \"{{allCatalogs}}\", lang: \"json\" %}\r\n</section>\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 \"allCatalogs\" to list all \"Catalogss\" 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/sample-catalog-1</li>\r\n    \r\n        <li>/catalogs/sample-catalog-2</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/sample-catalog-2</code></em></p>\r\n\r\n{% component type: \"snippet\", alias: \"code_block_processor\", data: \"{{data}}\", lang: \"liquid\" %}\r\n</section>\r\n</section>\r\n\r\n{% component type: \"snippet\", alias: \"section_counter\" %}\r\n</section>\r\n",
    "Weighting": 894,
    "DisableForSiteSearch": false,
    "CreatedByMemberId": "0",
    "ItemCategories": [],
    "ItemCategoryIdList": [],
    "ItemTags": [
      "Ecommerce"
    ],
    "Author": 0,
    "Author_Name": "",
    "Author_Url": "",
    "Item_Rating": 0,
    "Active": true,
    "IgnoreUpdates": true,
    "UpdatesLog": "<ul><li>27-Oct-2020 | 5.6.0 | Added 'ignoreWeighting' parameter</li><li>All new article</li></ul>",
    "ExternalResources": "",
    "AdditionalRelatedArticle": 0,
    "AdditionalRelatedArticle2": 0,
    "Authors": "2418",
    "ShowPageForSearchEngine": true,
    "MetaTitle": "",
    "SEOTitle": "",
    "MetaDescription": "This module component fetches data relating to eCommerce Catalogs and can be used to render Catalog structures and Products within them.",
    "CanonicalLink": "",
    "SocialMetaTags": "",
    "SeoPriority": 0.8,
    "EnableAMP": false,
    "AMPContent": "",
    "OpenGraphProperties": {
      "title": "",
      "type": "",
      "url": "",
      "locale": "",
      "image": ""
    },
    "ExternalId": 0,
    "Params": {
      "type": "snippet",
      "alias": "section_output",
      "data": "\r\n{% component type: \"module\", source: \"Catalogs\", layout: \"List\" %}\r\n",
      "lang": "liquid",
      "name": "SECTION Output",
      "content": "<section id=\"secOutput\">\n    <h2>Liquid Output</h2>",
      "enabled": true,
      "required": "true",
      "values": "List <em>(default)</em><br>&lt;Your Layout name&gt;"
    }
  },
  "Items": [
    {
      "Id": 2533,
      "Name": "Sample Catalog 1",
      "Url": "/catalogs/sample-catalog-1",
      "Url_List": [
        "/catalogs/sample-catalog-1"
      ],
      "UrlSlug": "sample-catalog-1",
      "ParentId": 2493,
      "ParentId_List": [
        -1
      ],
      "ParentName": "",
      "ParentUrl": "",
      "TemplateName": "",
      "Module_Alias": "Catalog",
      "Module_ID": 2493,
      "Enabled": true,
      "ReleaseDate": "2020-05-06T23:00:00",
      "ExpiryDate": "2099-12-11T13:00:00",
      "SiteSearchKeywords": [],
      "Description": "<p>Sample catalog for the ecommerce store.</p>",
      "Weighting": 0,
      "DisableForSiteSearch": false,
      "CreatedByMemberId": "0",
      "ItemCategories": [],
      "ItemCategoryIdList": [],
      "ItemTags": [],
      "Author": 0,
      "Author_Name": "",
      "Author_Url": "",
      "Item_Rating": 0,
      "Test1": null,
      "ThumbnailImage": "/images/template-detail-solar-mobile@2x.png",
      "ShowPageForSearchEngine": false,
      "MetaTitle": "",
      "SEOTitle": "",
      "MetaDescription": "",
      "CanonicalLink": "",
      "SocialMetaTags": "",
      "SeoPriority": 0.5,
      "EnableAMP": false,
      "AMPContent": "",
      "OpenGraphProperties": {
        "title": null,
        "type": null,
        "url": null,
        "locale": null,
        "image": null
      },
      "ExternalId": 0,
      "Params": {}
    },
    {
      "Id": 2534,
      "Name": "Sample Catalog 2",
      "Url": "/catalogs/sample-catalog-2",
      "Url_List": [
        "/catalogs/sample-catalog-2"
      ],
      "UrlSlug": "sample-catalog-2",
      "ParentId": 2493,
      "ParentId_List": [
        -1
      ],
      "ParentName": "",
      "ParentUrl": "",
      "TemplateName": "",
      "Module_Alias": "Catalog",
      "Module_ID": 2493,
      "Enabled": true,
      "ReleaseDate": "2020-05-06T23:00:00",
      "ExpiryDate": "2099-12-11T13:00:00",
      "SiteSearchKeywords": [
        "twotwo"
      ],
      "Description": "<p>Sample catalog for ecommerce store.</p>",
      "Weighting": 0,
      "DisableForSiteSearch": false,
      "CreatedByMemberId": "0",
      "ItemCategories": [],
      "ItemCategoryIdList": [],
      "ItemTags": [],
      "Author": 0,
      "Author_Name": "",
      "Author_Url": "",
      "Item_Rating": 0,
      "Test1": null,
      "ThumbnailImage": "/images/template-detail-juss-mobile@2x.png",
      "ShowPageForSearchEngine": false,
      "MetaTitle": "",
      "SEOTitle": "",
      "MetaDescription": "",
      "CanonicalLink": "",
      "SocialMetaTags": "",
      "SeoPriority": 0.5,
      "EnableAMP": false,
      "AMPContent": "",
      "OpenGraphProperties": {
        "title": null,
        "type": null,
        "url": null,
        "locale": null,
        "image": null
      },
      "ExternalId": 0,
      "Params": {}
    }
  ]
}

Accessing the Data

JSON Output

You can output the full JSON for your component data by referencing the root Liquid object {{this}} in your module’s layouts, or directly on your page, if using the collectionVariable parameter in your component tag.

For example:

{% component type: ... collectionVariable: "myData" %}

You can then render the JSON like so:

{{myData}}

For more details on using this approach, see Part 2 of the free ‘Learning Liquid Course’.

Rendering Property Values

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 "allCatalogs" to list all "Catalogss" across the site:

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

{% component type: "module", source: "Catalogs", layout: "", collectionVariable: "allCatalogs" %}

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

  • /catalogs/sample-catalog-1
  • /catalogs/sample-catalog-2

The code:

<ul>
    {% for i in allCatalogs.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/sample-catalog-2

{{allCatalogs.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

  • Site Settings & Management
    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.
  • Site Settings & Management
    Payment Settings

    Integrate various payment gateways, for multiple countries and currencies, into Treepl CMS for form payments, subscriptions and eCommerce workflows.
  • CRM
    Orders

    Orders store accounts of any payments made via the website and provide management for additional payments, invoices, order statuses, tracking info, the products purchased within the order and the details of the form submission used to take the order.
  • CRM
    Advanced CRM Groups

    Advanced CRM Groups allow you to extend the data fields within multiple areas of the CRM, either globally or on a per-record basis.
  • Liquid Objects & Usage
    {{ order }} object

    This liquid object will output the order details of a submitted payment. ...
  • Liquid Components
    module (Products)

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

    This component renders an anchor element allowing the javascript function to add the item to the shopping cart.
  • Liquid Components
    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.
  • Liquid Components
    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.
  • Liquid Components
    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.
  • Liquid Components
    related_items

    This component fetches related items of a specific source item, such as a Product that has had Related Products assign to it.
  • Liquid Components
    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.
  • Liquid Components
    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.
  • Liquid Components
    shopping_cart

    This component fetches data relating to the shopping cart, such as any products added, order totals, tax, shipping, etc.
  • Liquid Components
    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.
  • Liquid Components
    shippingProviderFields

    This component provides a placeholder for populating additional Shipping Provider options to the user.
  • Liquid Components
    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.
  • Liquid Components
    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.
  • Liquid Components
    orders

    This component fetches Orders from the CRM, either owned by the logged-in user or for all customer Orders.
  • eCommerce
    Getting Started

    To get started with the eCommerce module there are some overall settings to configure that provide eCommerce with further context in order to function appropriately for your situation.
  • eCommerce
    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.
  • eCommerce
    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.
  • eCommerce
    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.
  • eCommerce
    Gift vouchers

    Gift vouchers can be issued to your customers or purchased by them online via the shopping cart.
  • eCommerce
    Taxes

    Create any number of required tax codes specific to the shipping country selected in your Treepl CMS shopping cart.
  • Liquid Components
    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.
  • Liquid Components
    domain_settings

    This module component retrieves settings associated with the current domain, or optionally from another specified domain configured in the site instance.
  • eCommerce
    Shipping Options

    Treepl CMS provides the ability to configure both custom shipping options and integrated shipping providers based on a variety of conditions during the shopping cart stage.
  • eCommerce
    Settings

    These various eCommerce settings allow you to further control and customise the way your website functions, both in the admin and on the front-end, in terms of eCommerce functionality.
  • eCommerce
    eCommerce Javascript

    This is the provided javascript options for further controlling/customising the ecommerce javascript provided by the CMS.
  • Extensions
    Abandoned Cart Recovery

    With Abandoned Cart Recovery functionality, you can automatically send email reminders to customers who add products to their cart (while logged in) and leave without completing the order.
  • Public API
    CRM Orders

    Return or update Order item/s via the public API endpoint.
  • Extras
    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.