Support Forum

Removing 'Home' in breadcrumb leaves blank line

DM David McCarthy
David McCarthy
Member

Good afternoon

Progress is good – now have custom theme to which I’m making changes.

Wanted to remove the ‘Home’ link, and found info on this forum and in the codex.

However, it’s leaving a blank line ( <br> ) where Home used to be, and I can’t work out where it’s being generated. See images for view from Chrome’s Inspect, and source (from Firefox).

Code line changed to:

sp_BreadCrumbs('tagClass=spLeft spBreadCrumbs&tree=1');

Many thanks,

David

breadcrumb-issue-Chrome-Inspect.jpgbreadcrumb-issue-Firefox-Source.jpg

4 Answers

New Answer

IK Ike
Ike
Member

Hey David,

The way the arguments work is they either exist in your template function in their default state or your chosen state, or they don’t exist in the template function meaning they will work at their default state.

So by removing the homeLink argument it will still exist in the function, and will work in it’s default state (site URL). You’ve then removed the label from the end meaning it has nothing to display resulting in the break you’re seeing.

It should actually look more like this:

sp_BreadCrumbs('tagClass=spLeft spBreadCrumbs&tree=1&homeLink=', __sp('Home'));

By having nothing after the equals after homeLink it sees it as nothing and therefor has nothing to display.

Hope that helps!

DM David McCarthy
David McCarthy
Member

Hi Ike

I guess it must be adding a line break when it processes the breadcrumb list (in sp-common-view-functions.php).

However, the ‘flat’ breadscrumb list (option 0) doesn’t process the home link at all when the code is changed … there’s no gap or space where Home would have been.

Am I stuck with that line-break?

Thanks, David

DM David McCarthy
David McCarthy
Member

Hi again

Just added some compensation in CSS … added margin-top: -10px; to #spBreadCrumbs – I can always take it out if it causes problems elsewhere.

Thanks for your explaining stuff to me.

Regards, David

IK Ike
Ike
Member

Well on one hand I’m glad you’ve got it fixed to a standard you’re happy with, but on the other I’m not 100% sure it’s supposed to keep a break where ‘home’ was. It’s entirely possible that due to the way the breadcrumb tree displays that the break is a necessity, it’s certainly not too ugly, but we will have to wait for Andy or Steve to confirm this.