Introduction


In this set of Articles, we'll show you the Liquid syntax needed to get the most out of Categories on the Front End.

You can use Category IDs to filter WebApp, Module or eCommerce Product Items when including a List View in the Page.

Filtering by a Single Category or Multiple Categories


You can filter by a single Category using category_ids:

{% include 'module', id: '3', layout: 'default', per_page: '20', sort_type: 'properties.name', sort_order: 'asc', category_ids: '1' %}

You can filter by multiple Categories using comma-separated values in the category_ids parameter:

{% include 'module', id: '3', layout: 'default', per_page: '20', sort_type: 'properties.name', sort_order: 'asc', category_ids: '1,2,3' %}

WebApps and Modules


This parameter works whether you're filtering WebApps or Modules!

WebApp

{% include 'webapp', id: '3', layout: 'default', per_page: '20', sort_type: 'properties.name', sort_order: 'asc', category_ids: '1,2' %}

Module

{% include 'mdoule', id: '3', layout: 'default', per_page: '20', sort_type: 'properties.name', sort_order: 'asc', category_ids: '1,2' %}

eCommerce Products

{%- include 'ecommerce/products', layout: "my_layout", category_ids: '1,2', type: 'list' -%}

Nested Categories

If you filter by a Category which contains sub-Categories, the results will include all Items belonging to the Sub-Categories.

E.g. If you have a Products Category containing Merchandise and Music, filtering by the ID of the Products Category will return all Items belonging to Products, Merchandise and Music.


Related Articles

Did this answer your question?