Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Removing 'Home' in breadcrumb leaves blank line
Avatar
David McCarthy
Member
sp_UserOfflineSmall Offline
Apr 27, 2016 - 8:26 am

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.jpgImage Enlargerbreadcrumb-issue-Firefox-Source.jpgImage Enlarger

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 27, 2016 - 8:42 am

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!

Avatar
David McCarthy
Member
sp_UserOfflineSmall Offline
Apr 27, 2016 - 10:50 am

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

Avatar
David McCarthy
Member
sp_UserOfflineSmall Offline
Apr 27, 2016 - 10:58 am

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

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 27, 2016 - 2:40 pm

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.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626