PDA

View Full Version : Breadcrumbs are not for birds!


Antivirus
09-30-2006, 02:19 AM
My forums are located here:
www.mysite.com/forum/

My homepage is here:
www.mysite.com/

Problem is when viewing UserCP (or any other page within the forums), the breadcrumb looks as follows:
Homepage > User Control Panel

What I want is for (within every forum page) there to be a Forum Home within the breadcrumb, such as:
Homepage > Forumhome > User Control Panel

Now, my entire site uses the navbar template for all pages, even the custom homepage at www.mysite.com so what I need is some way to display a link within the breadcrumb to the Forum main index page, but only when viewing pages within the forums.

How would i go about doing that?

Adrian Schneider
09-30-2006, 02:31 AM
There doesn't seem to be a simple hook for doing it, but this should work as a file edit: functions.php (in the construct_navbits function), above foreach($nav_array AS $nav_url => $nav_title) add $navbits = array('/' => 'Your Site Name') + $navbits;You'll have to change 'Your Site Name' to your homepage name, and you'll probably want some sort of condition (using THIS_SCRIPT == 'x' is propably eaisest) to prevent this from running on your homepage.

peterska2
09-30-2006, 09:13 AM
i think it can also be done with a simple template edit. i'll get back to you on that

Princeton
09-30-2006, 11:42 PM
try this navbar template edit:


<if condition="is_array($navbits)">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="bottom">
<td><a href="#" onclick="history.back(1); return false;"><img src="$stylevar[imgdir_misc]/navbits_start.gif" alt="$vbphrase[go_back]" border="0" /></a></td>
<td>&nbsp;</td>
<td width="100%"><span class="navbar"><a href="$vboptions[homeurl]$session[sessionurl_q]" accesskey="1">$vboptions[hometitle]</a></span> <span class="navbar">&gt; <a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1">$vboptions[bbtitle]</a></span> $navbits[breadcrumb]</td>
</tr>
<tr>
<td class="navbar" style="font-size:10pt; padding-top:1px" colspan="3"><a href="$scriptpath"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink.gif" alt="$vbphrase[reload_this_page]" border="0" /></a> <strong>$navbits[lastelement]</strong></td>
</tr>
</table>
<else />
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="bottom">
<td><a href="#" onclick="history.back(1); return false;"><img src="$stylevar[imgdir_misc]/navbits_start.gif" alt="$vbphrase[go_back]" border="0" /></a></td>
<td>&nbsp;</td>
<td width="100%"><span class="navbar"><a href="$vboptions[homeurl].php$session[sessionurl_q]" accesskey="1">$vboptions[hometitle]</a></span> </td>
</tr>
<tr>
<td class="navbar" style="font-size:10pt; padding-top:1px" colspan="3"><a href="$scriptpath"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink.gif" alt="$vbphrase[reload_this_page]" border="0" /></a> <strong>$vboptions[bbtitle]</strong></td>
</tr>
</table>
</if>
replace existing code with the above