In this article
The objects available on each Zendesk page template are limited and can sometimes prevent you from creating the layouts that you want. The Article Lists plugin allows you to present a complete set of articles on any page using custom micro-templates.
Sections and categories can also be included to help build more advanced layouts like article trees.
The default template simply presents articles in an unstyled list.
When using a custom template additional data can be passed using the
templateData option and it may be necessary to fetch and process objects from the REST API first. For example, the following code could be used on the Section page:
The custom template could then render the article list with access to all categories, sections and articles as well as the current section and category objects.
collection object containing articles (and possibly categories and sections) is sorted and organized such that parent objects have a
children property, which is an array of child objects. For example, if categories are fetched, a given category’s
children array will contain all section objects belonging to that category.
|collection|| || ||An object containing an array of objects representing articles (as well as possibly sections and categories). If the collection is not provided, the plugin will fetch categories from the Zendesk REST API.|
|categories|| || ||True if category objects should be returned with articles.|
|sections|| || ||True if section objects should be returned with articles.|
|categoryId|| || ||Limit articles to those in a given category.|
|sectionId|| || ||Limit articles to those in a given section.|
|labels|| || ||Limit articles to those with a given set of labels.|
|properties|| ||See below||The list of properties from the REST API response to pass to the templating function.|
|template|| || ||The name of the template to use.|
|templateData|| || ||Additional data to expose to the templating function.|
The following article properties are passed to the templating function by default:
title(used for articles)
name(used for categories and sections)
The following section and category properties are required by the plugin to sort the collection of articles and also available within custom templates:
| ||Fires when the article list has been rendered.|