MyBB Community Forums

Full Version: Customizable Breadcrumb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm developing a theme and I noticed that for the breadcrumbs, I have to use:
<navigation>
which contains the following template code:
<!-- #navigation starts -->
<h2>
	{$nav}{$activesep}{$activebit}
</h2>
<!-- #navigation ends -->

So my question is this:
If I want to use the regular breadcrumb (by using <navigation>) AND then somewhere else on the same page of my theme, I want to just use {$activebit} is there a way I can do it without a plugin?
There is. I used it in my Majestic theme. Let me get the code.

I used:
<div class="page-name">{$activebit}</div>
<div class="navigation">
{$nav}{$activesep}{$activebit}
</div>

You would have to position the page name div absolutely if you want it to be somewhere where it's not close to the nav. Otherwise use margins or relative positioning.
I tried just using {$activebit} within my header template and it didn't work. So do i have to have that div with the pages name in order for it to work?

Also, with the navigation div, I would want to put that in my footer template, would this be possible too?

(I read somewhere that some template variables are restricted to certain templates.)
$activebit isn't global so you can't use it outside of the navigation template. You'd need a plugin to use it elsewhere.
You may be able to do this with CSS, that is, something like:
.hide_nav .navigation .nav_hide_part {
 display: none;
}
Modify your nav template to something like
<h2>
    <span class="nav_hide_part">{$nav}{$activesep}</span>{$activebit}
</h2>
And use it like (show everything):
<navigation>
or (show only activebit):
<span class="hide_nav"><navigation></span>

Crude, but may do what you want.
(2010-04-09, 05:17 AM)Yumi Wrote: [ -> ]You may be able to do this with CSS, that is, something like:
.hide_nav .navigation .nav_hide_part {
 display: none;
}
Modify your nav template to something like
<h2>
    <span class="nav_hide_part">{$nav}{$activesep}</span>{$activebit}
</h2>
And use it like (show everything):
<navigation>
or (show only activebit):
<span class="hide_nav"><navigation></span>

Crude, but may do what you want.

OMG! Yumi! You're a genius!!! I don't know why I didn't think of that!!! (I guess I'm NOT a genius) Big Grin

Thanks!