CategoryMenuUtility

class \TYPO3\CMS\Frontend\ContentObject\Menu\CategoryMenuUtility

Utility class for menus based on category collections of pages.

Returns all the relevant pages for rendering with a menu content object.

Table of Contents

Properties

$sortingField  : string

Methods

collectPages()  : array
Collects all pages for the selected categories, sorted according to configuration.
sortPages()  : array
Sorts the selected pages

Properties

$sortingField

protected static string $sortingField

Name of the field used for sorting the pages

Methods

collectPages()

Collects all pages for the selected categories, sorted according to configuration.

public collectPages(string $selectedCategories, array|null $configuration, AbstractMenuContentObject $parentObject) : array

Parameters

$selectedCategories : string

Comma-separated list of system categories primary keys

$configuration : array|null

TypoScript configuration for the "special." keyword

$parentObject : AbstractMenuContentObject

Back-reference to the calling object

Return values

array —

List of selected pages

sortPages()

Sorts the selected pages

protected sortPages(array $pages, string $order) : array

If the sorting field is not defined or does not corresponding to an existing field of the "pages" tables, the list of pages will remain unchanged.

Parameters

$pages : array

List of selected pages

$order : string

Order for sorting (should "asc" or "desc")

Return values

array —

Sorted list of pages

On this page