CoolCMS API

ChildrenNavigationTrait

One level of a nested-set tree (categories, regions): direct children of the selected node plus its parent for the way back.

Why not the full tree: CategoryList / RegionList load and hydrate every node on every request (461 Bazaar categories, ~9.5k regions) only to show one level. Here each level is its own small, cacheable query keyed by the parent id.

Shared by all modules; the node type is whatever the passed manager returns.

Table of Contents

Constants

CHILDREN_NAVIGATION_TEMPLATE_DIR  : string = __DIR__ . '/../../../Base/Front/Components/Chil...
Shared templates (`Style_1`) for every module's children list.

Methods

childrenNavigationTemplateDir()  : string
Module (or theme) copy of the template wins; otherwise the shared one.
loadChildrenNavigation()  : array{items: array, parent: object|null}

Constants

CHILDREN_NAVIGATION_TEMPLATE_DIR

Shared templates (`Style_1`) for every module's children list.

private string CHILDREN_NAVIGATION_TEMPLATE_DIR = __DIR__ . '/../../../Base/Front/Components/ChildrenNavigation'

Methods

childrenNavigationTemplateDir()

Module (or theme) copy of the template wins; otherwise the shared one.

protected childrenNavigationTemplateDir(string $ownDir, string $style) : string

Same lookup order as BaseComponent::setTemplateFile().

Parameters
$ownDir : string
$style : string
Return values
string
On this page

Search results