Log in

View Full Version : Duplicate breadcrumb on page


darnoldy
07-27-2005, 02:31 AM
Folks-

Okay, i'm stumped. Heeeeelp!

I want to split the navbar and breadcrumb, so I can duplicate the breadcrumb at the bottom of the page.

I created a new template called "navbar_breadcrumb", added a fetch_template line to the phpinclude_start template, and inserted a $navbar_breadcrumb variable into the proper pages, then copied the entire navbar script into navbar_breadcrumb.

Now, here's the strange part....

When I display the page, the breadcrumb that is produced by the navbar template works, the breadcrumb that is produced by navbar_breadcrumb does not! They are the *same* code.

The reason that it is not working seems to be that there is a conditional in the breadcrumb code:

<if condition="is_array($navbits)">

that is testing true in the navbar template and false in the navbar_breadcrumb template.

But I don't know why. Any suggestions, ideas?

--don

Adrian Schneider
07-27-2005, 02:40 AM
$navbits and $navbar are defined before the page is displayed, whereas php_include code is output at the end of the header template. Try putting it near the end of global.php.

I'm gonna go test this to double check, so I'll be back in a few mins.
---

Okay I got it working putting

eval('$navbar2 = "' . fetch_template('navbar2') . '";');
Just below (global.php)
eval('$header = "' . fetch_template('header') . '";');

Also, it seems I have to add $navbar2 into every template I want it used in... The easiest way I see doing this is a find replace: replace every instance of "$footer" and replace it with "$navbar2 $footer".

(well replace every navbar2 with navbar_breadcrumb, as that is what you used).

darnoldy
07-27-2005, 03:55 AM
Try putting it near the end of global.php.First, thanks for helping!

Okay, I edited global.php--and nothing blew up <g>! However, still no joy. Although the template displays, the breadcrumb won't leave crumbs.

If you look at the attachment, you can see what I mean. The upper navbar/breadcrumb is produced by $navbar, the lower navbar/breadcrumb is produced by $navbar_breadcrumb. Again, these two template contain exactly the same code.

:surprised: don