How to hardcode breadcrumb in theme ?
Permalink
Hi, I am trying to add breadcrumbs on every page by adding php code snippet to page templates. But it does not show it as breadcrumb trail. It shows subpages as list.
here is my code:
$nav = BlockType::getByHandle('autonav');
$nav->controller->orderBy = 'display_asc';
$nav->controller->displayPages = 'top';
$nav->controller->displaySubPages = 'relevant_breadcrumb';
$nav->controller->displaySubPageLevels = 'enough';
$nav->render('templates/breadcrumb');
I don't have any breadcrumb.php file inside
concrete/blocks/autonav/templates
How can i do it. Please help me.
here is my code:
$nav = BlockType::getByHandle('autonav');
$nav->controller->orderBy = 'display_asc';
$nav->controller->displayPages = 'top';
$nav->controller->displaySubPages = 'relevant_breadcrumb';
$nav->controller->displaySubPageLevels = 'enough';
$nav->render('templates/breadcrumb');
I don't have any breadcrumb.php file inside
concrete/blocks/autonav/templates
How can i do it. Please help me.
I am using 5.7.3 and you mean i need to create "blocks" in root folder ?
Hi srjahir32,
What about using a global area for the breadcrumb nav instead of hard coding it?
http://concrete5tricks.com/blog/dont-hardcode-blocks-use-a-global-a...
What about using a global area for the breadcrumb nav instead of hard coding it?
http://concrete5tricks.com/blog/dont-hardcode-blocks-use-a-global-a...
Uranus
He already said he is using 5.7.3
This addon Works With 5.3.0 — 5.6.3.3
He already said he is using 5.7.3
This addon Works With 5.3.0 — 5.6.3.3
Anyway I'm attaching the file as .zip. Extract & put this file in root/blocks/autonav/templates folder.
Rony