Support Forum

Breadcrumbs nested or on a single line

64 Answers

New Answer

MP Mr Papa
Mr Papa
Member

the options page were far from simple and most users couldnt find the options they wanted…  we were constantly having to tell folks where to go for certain options and also telling people to edit the core code to move things around like they wanted… panels and panels of options is not simple wink

UN
Unknown
Member

It says here to change the breadcrumbs you have to edit the code to make them a straight line.  But what about when we later upgrade Simple Press?  Do all of our changes disappear? Do we have to put the code back in there again, or is it smart enough to know?

MP Mr Papa
Mr Papa
Member

No. for 5.0 no core editing needed… you need to edit your sp theme… in which case, you should make your own theme, copying one of ours to start if you want…

then add a tree=0 argument to the breadcrumbs template tag call…

UN
Unknown
Member

Lee H said

try adding &homeLink= to your args

Dear Lee

I fixed the sphead.php which is awesome.

I am not the smartest fish in the pond so what is “args” in this content and where is it located?

Kind regards

Philip

YS Yellow Swordfish
Yellow Swordfish
Member

‘args’ is shorthand for ‘arguments’ which is just another name for ‘parameters’. They are the items that can be passed to a function to switch things on or off or change the display method. Each template function supports a number of ‘args’ that can be used to alter things – like – in this case – the breadcrumbs.

MA mann
mann
Member

Yellow Swordfish said
One of the major points about moving to themes and templates is that display options should now be set by the tags – not by hard coded options. The problem – I do appreciate – is that there is no documentation for these as yet but of you want to make this change let me know and I will tell you where and how.

Oh – why wait!

The template is the spHead.php

The tag is:

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

Just change the ‘tree’ parameter from 1 to a zero.

Worked like a charm!

MB Matthew Bonner
Matthew Bonner
Member

Is there a plug in to make the bread crumbs appear like the ones you guys are using, single line with the gray background?

DI Duke Leto III
Duke Leto III
Member

Lee H said
try adding &homeLink= to your args

Can you elaborate? 

I tried: sp_BreadCrumbs(‘tagClass=spLeft spBreadCrumbs&tree=0 &homeLink= ‘, __sp(‘Home’));

which seemed to have no effect. 

 

Also, How would one go about changing the arrows to ‘>’ or ‘/’ or some such? 

MP Mr Papa
Mr Papa
Member

No, its just a modification to standard non tree breadcrumbs… a little css magic and some images…

Brandon C did the work for our theme, so I will let him give you some tips when he stops by the forum… you could of course, inspect the css here to see what is done… >

MB Matthew Bonner
Matthew Bonner
Member

Okay I see, I’m familiar with CSS just not sure what SP file to post it in …my theme overlay?

MP Mr Papa
Mr Papa
Member

you would want to put any css files in your sp theme, the main theme file – not the overlay…

additionally, you will need to grab the 3 images we use… and put the following in your spFunctions.php file for the sp theme..

/* Functions for Breadcrumb Z-Index Sorting */
function spSortBreadcrumbs($breadCrumbs, $a='', $crumbEnd='', $crumbSpace='', $treeCount='') {
    global $no;
    $no = substr_count($breadCrumbs, 'spLink') + 2;
    $breadCrumbs = preg_replace_callback(
        '|href=|',
        create_function(
            '$matches',
            'global $no; $no--; return 'ID="BreadcrumbPosition'.$no.'" " style="z-index:'.$no.'" '.$matches[0];'
        ),
        $breadCrumbs);
        
    return $breadCrumbs;
}
add_filter('sph_BreadCrumbs', 'spSortBreadcrumbs');

so, yeah, sorry a bit more than just css… the above php code is adding in some z-index css to control display…

If the custom php and css is too much, you can always contact Brandon via the Custom SP Theme Work banner in the right sidebar…

MB Matthew Bonner
Matthew Bonner
Member

Thanks a lot, I’m gonna tinker with it tonight! Sorry if it seems I post frequently, but this plugin seems almost endless with possibilities. It’s truly the most smoothly integrated forum plugin I’ve worked with EVER. Glad to be a customer.

BR Brandon
Brandon
Member

@Duke Leto III – Diid you enter the actual link into the code after homeLink=?

@Matthew Bonner – Let us know if you need any help but the code and images are really in a beta mode step. What Mr. Papa posted works but there is a small syntax error in the breadcrumbs function and the images need to be combined for better user interaction.

@Mr Papa – You double posted #25 & #26. PBE issue?

MP Mr Papa
Mr Papa
Member

No worries – that’s why we are here… Thanks for the kind words! Nice to hear now and then… wink