Categories HMENU

Makes a menu of pages belonging to one or more categories. If a page belongs to several of the selected categories, it will appear only once. By default pages are unsorted.

Each in the resulting array of pages gets an additional entry with key _categories containing the list of categories the page belongs to, as a comma-separated list of uid's. It can be accessed with field or data like any other field.

Properties

special.value

Property

special.value

Data type

list of categories / stdWrap

Description

Comma-separated list of categories uid's.

Example:

20 = HMENU
20 {
    special = categories
    special.value = 1,2
    1 = TMENU
    1.NO {
            ...
    }
}

special.relation

Property

special.relation

Data type

string / stdWrap

Default

special.categories

Description

Name of the categories-relation field to use for building the list of categorized pages, as there can be several such fields on a given table.

special.sorting

Property

special.sorting

Data type

string / stdWrap

Description

Which field from the "pages" table should be used for sorting. Language overlays are taken into account, so alphabetical sorting on the "title" field, for example, will work.

If an unknown field is defined, the pages will not be sorted.

special.order

Property

special.order

Data type

"asc" or "desc" / stdWrap

Default

asc

Description

Order in which the pages should be ordered, ascending or descending. Should be "asc" or "desc", case-insensitive. Will default to "asc" in case of invalid value.

[tsref:(cObject).HMENU.special = categories]

Example