Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save factoryhr/8886630a48f6f115bc5bd797caf5e234 to your computer and use it in GitHub Desktop.
Save factoryhr/8886630a48f6f115bc5bd797caf5e234 to your computer and use it in GitHub Desktop.
$mainNavigation = $this->navigation()->buildNavigation($document, $mainNavStartNode, null, function($page, $document) {
if($document->getProperty("templateType") == "brand" && $document->getProperty("globalRootBrand")) {
// Loop through "brands" directory children
foreach($document->getProperty("globalRootBrand")->getChilds() as $brand) {
// Dynamically create document page
$page->addPage(new Pimcore\Navigation\Page\Document([
"label" => $brand->getName(),
"id" => "brand-" . $brand->getId(),
"uri" => $this->pimcoreUrl(array('id' => $brand->getId()), "brand")
]));
}
}
// ...
@factoryhr
Copy link
Author

Blog post - Pimcore learning experience - brand navigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment