Change log


This module component fetches data relating to Categories allocated to a specific module.

{% component type: "module_category_list", module: "<Module name/ID>" %}

Only Categories that are assigned to items within the specified module are returned. In other words, Categories with an item count of 0 won't be returned.

Parameters and Options


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

<Module name/ID>
The module’s entity/alias name or ID that the data is to be sourced from.
<Parent ID>

The module group ID the data is to be sourced from.

Path to file that will contain the Liquid layout content to be parsed.

If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).


The name of the property to sort by. If empty or not present, alpha/numeric sorting will be used based on the item's name.
ASC (default)

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.

Maximum number of Categories to be rendered (unspecified parameter will show ALL items)
collection (default)

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

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.

Liquid Output

The below example shows the system Categories associated with the Blog module. The Liquid data output from this example would look like the following (for example, when using a collectionVariable to create the collection):

  "Items": [
      "Name": "Blog: News & Events",
      "ItemsCount": 2,
      "FullName": "Blog: News & Events",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Blog%3A%20News%20%26%20Events",
      "Id": "1344"
      "Name": "G1 Sub Cat I",
      "ItemsCount": 2,
      "FullName": "Group 1/G1 Sub Cat I",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Group%201%2FG1%20Sub%20Cat%20I",
      "Id": "1349"
      "Name": "Sample Category",
      "ItemsCount": 1,
      "FullName": "Sample Category",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Sample%20Category",
      "Id": "1346"
      "Name": "Group 2",
      "ItemsCount": 1,
      "FullName": "Group 2",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Group%202",
      "Id": "1348"
      "Name": "G1 Sub Sub Cat I",
      "ItemsCount": 1,
      "FullName": "Group 1/G1 Sub Cat I/G1 Sub Sub Cat I",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Group%201%2FG1%20Sub%20Cat%20I%2FG1%20Sub%20Sub%20Cat%20I",
      "Id": "1353"
      "Name": "G1 Sub Cat II",
      "ItemsCount": 1,
      "FullName": "Group 1/G1 Sub Cat II",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Group%201%2FG1%20Sub%20Cat%20II",
      "Id": "1350"
      "Name": "G2 Sub Cat II",
      "ItemsCount": 1,
      "FullName": "Group 2/G2 Sub Cat II",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Group%202%2FG2%20Sub%20Cat%20II",
      "Id": "1352"
      "Name": "Blog: Special Deals",
      "ItemsCount": 1,
      "FullName": "Blog: Special Deals",
      "Url": "?prop_ModuleId=1534&prop_ItemCategories=Blog%3A%20Special%20Deals",
      "Id": "1345"
  "Params": {
    "type": "module_category_list",
    "module": "Blog Post",
    "layout": "",
    "collectionvariable": "catCollection"

The data exposed is explained further in the table below:

System ID of the Category.
The name of the Category.
The full 'path' name of the Category. When nested sub Categories are used, the parent names are included in the naming structure (eg: 'Top Level/Sub Level/Category Name')

A formatted URL with parameter string that can be used, along with your module component configured with the isSearchResults: "true" parameter, to display all module items using the Category.

See the 'Liquid Components' documentation for the module you are working with for more info on using the isSearchResults parameter.

The pattern used to format this URL is as follows:
[[parentItemUrl]]?prop_ModuleId=[[moduleId]]&prop_ParentId=[[parentItemId]]&prop_ItemCategories=[[categoryName (UrlEncoded) ]]

For example, using the component to reference a top level module (let's use the Blog module), ie:
{% component type:"module_category_list", module:"Blog Post" %}

The URL output would be:

Additionally, if using the component to reference a parent group via the parentItemId parameter (let's use a specific Blog within the Blog module), ie:
{% component type:"module_category_list", module:"Blog Post", parentItemId:"1234" %}
where '1234' is the ID of your specific blog parent/group item.

The URL output would be:


The number of items, within the specified module, that have this Category assigned.

Virtual Layout

Based on the above example, if not using any custom layout or collection, the default virtual layout will output as a list with name, link and item count:

    {% for item in this.items %}
            <a href="{{item.url}}" title="{{}}">{{}} <span>({{item.itemsCount}})</span></a>
    {% endfor %}

Rendering the list:

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:


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 a custom defined Layout via the this.items object and a forloop (since the default object type is a collection).

{% component type: "module_category_list", layout: "/snippets/", module: "Blog Post" %}

Example of a forloop in the custom layout file

{% for category in this.items %}
{% endfor %}

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

An example using collectionVariable with value "catCollection" for the Blog module:

{% component type: "module_category_list", collectionVariable: "catCollection", module: "Blog Post" %}

Using the following forloop directly on the page:

    {% for category in catCollection.items %}
    {% endfor %}

Renders all the item names in a list:

  • Blog: News & Events
  • G1 Sub Cat I
  • Sample Category
  • Group 2
  • G1 Sub Sub Cat I
  • G1 Sub Cat II
  • G2 Sub Cat II
  • Blog: Special Deals

Accessing a specific item within the collection. In this case the third item (zero based index), which in our example would render the value Sample Category


External Resources

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


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 and we will consult you as soon as possible.