WebsiteBaker Support (2.8.x) > Templates, Menus & Design
breadcrumb help
bgg:
This is the default Breadcrumbs (all):
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]">[a][menu_title]</a>');
You are here: Home
But when we browse a page other then homepage and iyts sub pages, the HOME button with link to homepage goes off.
how can I always have the HOME link in the breadcrumb?
kweitzel:
that lies within the "limitations" ... since all root level pages have the same root status, they will be shown first. You would need to manually make this happen. Some construct like:
--- Code: ---<?php
if (ROOT_PARENT <= 1) {
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]">[a][menu_title]</a>');
} else {
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b><span class="[class]"><a href="http://localhost/wb">HOMEPAGE</a> > </span> <span class="[class]">[a][menu_title]</a>');
}
?>
--- End code ---
ATTN: untested, no warranty that it will work.
cheers
Klaus
bgg:
My Homepage ID is 4 !
I have two menus: Menu is# 1, and Menu ID#4.
How do I display 'Home >' displayed in case of all the pages belongs to the 2 menus?
--- Code: ---<?php
if (ROOT_PARENT == 4) {
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]">[a][menu_title]</a>');
} else if {
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]"><a href="/">Home</a> ></span> <span class="[class]">[a][menu_title]</a>');
} else {
show_menu2(4, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]"><a href="/">Home</a> ></span> <span class="[class]">[a][menu_title]</a>');
}
?>
--- End code ---
Thanks!
bgg:
Sorry, I forgot to mention:
My 'home'-page is under a hidden menu, meaning it does not come with the Menu(1).
bgg:
correct code or breadcrumb with HOME is below :)
--- Code: ---<?php
if (PAGE_ID == 4) {
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]">[a][menu_title]</a>');
}
else {
show_menu2(0, SM2_ROOT, SM2_CURR, SM2_CRUMB, '<span class="[class]"> > [a][menu_title]</a>', '</span>', '', '', '<b>You are here:</b> <span class="[class]"><a href="/">Home</a> ></span> <span class="[class]">[a][menu_title]</a>');
}
?>
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version