You are here:  » Help With Custom Breadcrumbs

Active Forum Topics


Help With Custom Breadcrumbs

Submitted by tommo101 on Wed, 2019-08-21 21:08 in

I'm a bit stuck trying to do something with breadcrumbs and was wondering if you could assist me a wee bit.

I've added a little article section to one of my websites.

So the top level for the section is called Buyers Guides

So my breadcrumbs for that is:

Home > Buyers Guides

which is:

$banner["breadcrumbs"][] = array("title"=>"Buyers Guides","href"=>$config_baseHREF."buyers-guides.php");

But what I want to be able to do is make it so when I add a new page with an article, the breadcrumb for that would then show as:

Home > Buyers Guides > Article Title

But that is where i've got completely stuck and going round in circles getting nowhere, all I can get it to do is:

Home > Article Title

Can you possibly assist me with this one please and thanks.

Submitted by support on Thu, 2019-08-22 09:16

Hi,

The effect of [] after an array variable ( $banner["breadcrumbs"] in this case ) is to append a value to the end of the array, so to add additional breadcrumbs you can just repeat the line - have a go with;

$banner["breadcrumbs"][] = array("title"=>"Buyers Guides","href"=>$config_baseHREF."buyers-guides.php");
$banner["breadcrumbs"][] = array("title"=>"Article Title","href"=>$config_baseHREF."article.php");

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by tommo101 on Fri, 2019-08-23 13:22

Thanks so much. Worked perfectly.