WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: bgg on October 05, 2007, 03:36:14 PM

Title: breadcrumb help
Post by: bgg on October 05, 2007, 03:36:14 PM
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?

Title: Re: breadcrumb help
Post by: kweitzel on October 06, 2007, 07:57:33 AM
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: [Select]
<?php
if (ROOT_PARENT <= 1) {
show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB, &#39;<span class="[class]"> > [a][menu_title]</a>&#39;, &#39;</span>&#39;, &#39;&#39;, &#39;&#39;, &#39;<b>You are here:</b> <span class="[class]">[a][menu_title]</a>&#39;);
} else {
show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB, &#39;<span class="[class]"> > [a][menu_title]</a>&#39;, &#39;</span>&#39;, &#39;&#39;, &#39;&#39;, &#39;<b>You are here:</b><span class="[class]"><a href="http://localhost/wb">HOMEPAGE</a> > </span> <span class="[class]">[a][menu_title]</a>&#39;);
}
?>


ATTN: untested, no warranty that it will work.

cheers

Klaus
Title: Re: breadcrumb help
Post by: bgg on September 09, 2008, 03:08:37 PM
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: [Select]
<?php
if (ROOT_PARENT == 4) {
show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB, &#39;<span class="[class]"> > [a][menu_title]</a>&#39;, &#39;</span>&#39;, &#39;&#39;, &#39;&#39;, &#39;<b>You are here:</b> <span class="[class]">[a][menu_title]</a>&#39;);
} else if {
show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB, &#39;<span class="[class]"> > [a][menu_title]</a>&#39;, &#39;</span>&#39;, &#39;&#39;, &#39;&#39;, &#39;<b>You are here:</b> <span class="[class]"><a href="/">Home</a> ></span>  <span class="[class]">[a][menu_title]</a>&#39;);
} else {
show_menu2(4SM2_ROOTSM2_CURRSM2_CRUMB, &#39;<span class="[class]"> > [a][menu_title]</a>&#39;, &#39;</span>&#39;, &#39;&#39;, &#39;&#39;, &#39;<b>You are here:</b> <span class="[class]"><a href="/">Home</a> ></span>  <span class="[class]">[a][menu_title]</a>&#39;);
}

?>

Thanks!
Title: Re: breadcrumb help
Post by: bgg on September 09, 2008, 03:23:55 PM
Sorry, I forgot to mention:

My 'home'-page is under a hidden menu, meaning it does not come with the Menu(1).
Title: SOLVED
Post by: bgg on September 10, 2008, 10:33:13 AM
correct  code or breadcrumb with HOME is below :)

Code: [Select]
<?php

if (PAGE_ID == 4) {
show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB, &#39;<span class="[class]"> > [a][menu_title]</a>&#39;, &#39;</span>&#39;, &#39;&#39;, &#39;&#39;, &#39;<b>You are here:</b> <span class="[class]">[a][menu_title]</a>&#39;);
}
 

else {
show_menu2(0SM2_ROOTSM2_CURRSM2_CRUMB, &#39;<span class="[class]"> > [a][menu_title]</a>&#39;, &#39;</span>&#39;, &#39;&#39;, &#39;&#39;, &#39;<b>You are here:</b> <span class="[class]"><a href="/">Home</a> ></span>  <span class="[class]">[a][menu_title]</a>&#39;);
}  

?>
Title: Re: breadcrumb help
Post by: LonelyWolf on June 27, 2011, 11:51:49 AM
Just my 2 cents, a little better for home link:

[original code posted by bgg, over this post]

Code: [Select]
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="'.WB_URL.'">Home</a> ></span>  <span class="[class]">[a][menu_title]</a>');

Title: Re: breadcrumb help
Post by: deekodesk on June 27, 2011, 01:49:46 PM
My developer has done it as i wanted but i have a query..do we need to have rewrite Rule on in .htaccess files...and what other feilds we can include in URLs like date, Keywords, Author name, product name etc...