MyBB Community Forums

Full Version: Navigation Template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone explain to me how the navigation template works?

I saw that in the default template,
<navigation>
was used but there's no template actually named navigation. It looks as if the main navigation template is called, nav. However, I also notice inside of the nav template, it refers to itself?
<div class="navigation">
{$nav}{$activesep}{$activebit}
</div>

How does that work? Wouldn't it be an endless loop because it keeps referring to itself?

Thanks in advance!
the div is pointing to the class navigation in the css.

There is a template called navigation. When you click it you will see nav.

It is calling upon that entire set with <navigation>
But then why would
<navigation>
be used as opposed to
{$nav}
??
Because <navigation> calls the whole section.
The MyBB devs decided to be a little quirky with that and do something a little different with the navigation bar.

Well, not entirely true, due to how MyBB works, but that's the effect anyway.
I'm not sure if there's a simple way to explain this, but the navigation is stored in the header template or somewhere around there, but only evaluated before the main page is executed. However, the navigation can only be built after the main page has been executed. So the standard types of variables like {$nav} won't work.

Basically, MyBB is coded to specifically replace <nagivation> with the nav template.
okay, thanks Yumi