listConfig

defines or changes the selection of pages within the listing object. The listing object gets created automatically and contains by default all (non-hidden) pages.

This tool doesn't output any markup. You can use @t(listPages) to output the selection as a list of pages.

@t(listConfig{ Options })

Options

type: false - string or false

Defines the type of listing.
Possible values are:

  • false - all pages
  • "children" - all subpages of the current page (or page defined for "parent")
  • "related" - all pages having tags in common with the current page
  • "siblings" - all siblings of the current page

parent: false - string or false

Only available in case type is set to "children". If an URL is defined, that URL will be used as the children's parent page. If parent: false (default), the current page is used.

template: false - string or false

Filters the set of pages by template. false equals no filtering.

sortItem: false - string or false

The default item (page variable) to sort the listing by, if no other value is passed as parameter via a sort menu. false equals the file system order.

sortOrder: "desc" - string

The default sorting order of the listing, if no other value is passed as parameter via a sort menu.
Allowed values are:

  • "asc" - ascending sort order
  • "desc" - descending sort order

offset: 0 - integer

The offset parameter can be used to reduce the amount of relevant (all, children or related) pages of the listing. If the offset is non-negative then the array of pages of the listing will start at the defined value of the relevant page collection. If offset is negative then the listing's array will start that far from the end of the collection. In contrast to the offset parameter of the listPages() method, this one actually affects not only the output of pages, but also the array of relevant pages and tags of the listing.

limit: NULL - integer or NULL

The limit parameter limits the number of relevant (all, children or related) pages within the listing. If limit is negative then the set of pages will stop that many elements from the end of the array of relevant pages within the listing. In contrast to the limit parameter of the listPages() method, this one will actually affect not only the output of pages, but also the array of relevant pages and tags of the listing.


Example

A selection of pages, having tags in common with the current page and "project" as their template:

<div class="listing">
    @t(listConfig{ type: "related", template: "project" })
    @t(listPages) 
</div>
See also