Hardcoded Breadcrumb autonav doesn't work
Permalink 3 users found helpful
Hi,
I'm trying to hardcode in a breadcrumb nav into one of my templates. I've created a scrapbook called 'Global scrapbook', added an autonav block to it and tried both setting the custom template 'breadcrumbs' in the block itself and from the option in the scrapbook, but the trail isn't showing.
This is the code I have in my template and I've named the block in my Global scrapbook 'Breadcrumbs'. It's appearing, but not showing the trail when I choose that custom template - any ideas of what's going on? I can add a block and make it a breadcrumb trail when I insert it as a normal block in Edit mode, but it's just not working when I use the autnoav from my Global scrapbook and apply the breadcrumb template...
I've also attached a screenshot showing what I mean.
Thanks
osu
I'm trying to hardcode in a breadcrumb nav into one of my templates. I've created a scrapbook called 'Global scrapbook', added an autonav block to it and tried both setting the custom template 'breadcrumbs' in the block itself and from the option in the scrapbook, but the trail isn't showing.
This is the code I have in my template and I've named the block in my Global scrapbook 'Breadcrumbs'. It's appearing, but not showing the trail when I choose that custom template - any ideas of what's going on? I can add a block and make it a breadcrumb trail when I insert it as a normal block in Edit mode, but it's just not working when I use the autnoav from my Global scrapbook and apply the breadcrumb template...
<?php $BreadcrumbsBlock = Block::getByName('Breadcrumbs'); $bv = new BlockView(); $bv->render($BreadcrumbsBlock); ?>
I've also attached a screenshot showing what I mean.
Thanks
osu
You could also skip the scrapbook and insert a hard-coded block directly into the theme.
Here's what I'm using
Here's what I'm using
<?php $bt_main = BlockType::getByHandle('autonav'); $bt_main->controller->displayPages = 'top'; $bt_main->controller->orderBy = 'display_asc'; $bt_main->controller->displaySubPages = 'relevant_breadcrumb'; $bt_main->controller->displaySubPageLevels = 'all'; $bt_main->controller->displayPagesIncludeSelf = 1; $bt_main->render('templates/breadcrumb'); ?>
Worked perfectly, thanks.
Hi glockops
I am rather new to concrete
Could you please telle a bit more in how to
do this...
or even better attach a sample a it
Hope you can help :-)
REGARDS
Flemming
I am rather new to concrete
Could you please telle a bit more in how to
do this...
or even better attach a sample a it
Hope you can help :-)
REGARDS
Flemming
The code @glockops posted is the sample -- just copy that and paste it into your theme template in the spot where you want the menu html to be.
Hi glockops
I am rather new to concrete
Could you please telle a bit more in how to
do this...
or even better attach a sample a it
Hope you can help :-)
REGARDS
Flemming
I am rather new to concrete
Could you please telle a bit more in how to
do this...
or even better attach a sample a it
Hope you can help :-)
REGARDS
Flemming
If this is the case, perhaps you could try adding the block as a "copy" instead of as an "alias" to the page?