Introduction
Categories provide a flexible and powerful method for grouping your WebApp and Module items.
In this set of Articles, we'll show you the Liquid syntax needed to get the most out of Categories on the Front End.
Here is a summary of the features we'll cover. As Categories are integrated with a wide range of other features, we'll group the features by the context or types of files in which they can be used.
Outputting General Information about Categories
The following features are available in all Siteglide files that support Liquid, including Pages, Templates, Layouts and more.
- Outputting the Categories data Object
- Accessing a specific Category via ID
- After accessing the Category, outputting its fields
- Looping over all Categories on the Site
WebApp / Module / eCommerce Layouts
The following features are available in Layouts only, as they require access to a particular Item's category_array field. In Module Layouts, they'll only be available in the item.liquid file.
- Using the category_array field to access the IDs of Categories that have been assigned to the current Item
- Displaying all Categories that belong to the current Item
- Displaying the first, last or nth Category which belongs to the current Item
Filtering WebApps and Modules by Categories
You can use Category IDs to filter WebApp or Module Items when including a List View in the Page.
- Using the category_ids parameter to filter WebApps and Modules
Category Layouts
When setting up your Categories you had the option to allow Detail Pages for each Category. The following features are available only on Category Detail Page Layouts:
- Category Breadcrumbs
- Parent Category List
- Child Category List
- Items in this Category