PDA

View Full Version : Remove or Edit "Forum" link in breadcrumbs


SiFor
07-17-2014, 05:11 AM
How is it possible to Edit or Remove the "Forum" link in the breadcrumb links. I would rather it not be there or have it point to the root of the domain.

SiFor
07-18-2014, 01:51 AM
Pointing the link to root would even be great.

SiFor
07-23-2014, 03:17 AM
Anyone? So quite here.

Dead Eddie
07-23-2014, 04:42 AM
The breadcrumbs are echo'd out in the header template. You should be able to work with a conditional to remove the breadcrumb if it's title (or phrase?) is Forum.

I'd help more, but my vb5 install is torched on the frontend.

Dave
07-23-2014, 07:58 AM
I believe the location of this is in the navbar template all the way at the bottom.

SiFor
07-23-2014, 09:57 AM
In vb 4 this was fairly simple for somebody like me with limited knowledge but in vb5 its a different story.

This looks to be the section in the header template:


<vb:if condition="$page['crumbs']">
{vb:set breadcrumbSchema.itemprop, breadcrumb}
<ul id="breadcrumbs" class="h-clearfix" {vb:schema {vb:raw breadcrumbSchema}}>
<li class="crumb ellipsis"><a class="crumb-link" href="{vb:raw baseurl}/">{vb:phrase home}</a></li>
<vb:each from="page.crumbs" value="crumb">
<vb:if condition="isset($crumb['phrase']) AND !empty($crumb['phrase'])">
{vb:set crumbTitle, {vb:rawphrase {vb:raw crumb.phrase}}}
<vb:else />
<vb:comment><!-- Since we don't want phrase placeholders to be escaped, we escape user titles here. --></vb:comment>
{vb:set crumbTitle, {vb:raw crumb.title}}
</vb:if>
<li class="vb-icon separator"></li>
<li class="crumb ellipsis"><vb:if condition="$crumb['url']"><a class="crumb-link" href="{vb:raw baseurl}{vb:raw crumb.url}">{vb:raw crumbTitle}</a><vb:else />{vb:raw crumbTitle}</vb:if></li>
</vb:each>
</ul>
<vb:else />
<vb:comment>
We still need the #breadcrumbs element (even though empty) to avoid having multiple CSS rules to deal with different scenarios
where adjacent elements - breadcrumbs, channel-subtabbar, notices, announcements are available, visible, hidden or empty.
Used div instead of ul to prevent having an empty ul which is invalid in XHTML 1.0 Strict (though valid in HTML5).
Though we are currently using HTML5 doctype, using an emtpy div will ensure that this will validate even if we change the doctype in the future.
</vb:comment>
<div id="breadcrumbs"></div>
</vb:if>

Dave
07-23-2014, 10:10 AM
Oh oops, didn't know this was posted in the vBulletin 5 section. My bad. c:

Dead Eddie
07-23-2014, 11:41 AM
<vb:if condition="isset($crumb['phrase']) AND !empty($crumb['phrase'])">
{vb:set crumbTitle, {vb:rawphrase {vb:raw crumb.phrase}}}
<vb:else />

Ultimately, it's probably going to look something like this:
<vb:if condition="isset($crumb['phrase']) AND !empty($crumb['phrase'])">
<vb:if condition="$crumb['phrase'] != 'forum'>
{vb:set crumbTitle, {vb:rawphrase {vb:raw crumb.phrase}}}
</vb:if>
<vb:else />

SiFor
07-24-2014, 08:11 AM
Thanks for the help but I get "Invalid Tag Nesting" when trying to use your code.

Dead Eddie
07-24-2014, 11:13 PM
<vb:each from="page.crumbs" value="crumb">
<vb:if condition="isset($crumb['phrase']) AND !empty($crumb['phrase'])">
<vb:if condition="$crumb['phrase'] != 'forum'">
{vb:set crumbTitle, {vb:rawphrase {vb:raw crumb.phrase}}}
</vb:if>
<vb:else />


This didn't give me an error.

(Oops, I see I forgot a closing '"' up in #8)

SiFor
07-25-2014, 12:08 AM
Thanks again for helping, this time no error but the link is still visible and has not changed, it still points to /forum.

Dead Eddie
07-25-2014, 01:00 AM
Try this, down lower. The only custom code is the <vb:if condition="$crumbTitle != 'Forum'"> </vb:if> part.

<vb:if condition="$crumbTitle != 'Forum'">
<li class="vb-icon separator"></li>
<li class="crumb ellipsis"><vb:if condition="$crumb['url']"><a class="crumb-link" href="{vb:raw baseurl}{vb:raw crumb.url}">{vb:raw crumbTitle}</a><vb:else />{vb:raw crumbTitle}</vb:if></li></vb:if>

Sorry, like I said, the frontend of my vb5 install is hosed. I'm using the style editor, but I can't check my work.

SiFor
07-25-2014, 02:05 AM
That did it, thank you very much for your help. It is very much appreciated. :)