kevin78 Posted May 2, 2013 Share Posted May 2, 2013 Hello I would like to modify the breadcrump (without editing with CSS). Indeed, I just want to add a tag <strong> to the last word, on the breadcrump, like this : Accueil > Ipad > Ipad 2 > Ipad 2 16 Go I have tried to edit without success these two files : - tool.php, fonction "getPath" - breadcrump.tpl Please help me Link to comment Share on other sites More sharing options...
PascalVG Posted May 3, 2013 Share Posted May 3, 2013 (edited) Hi Kevin, Try this: Edit /themes/default/breadcrumb.tpl Change contents into: <!-- Breadcrumb -->{if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if}<div class="breadcrumb"><a href="{$base_dir}" title="{l s='Return to Home'}"><img src="{$img_dir}icon/home.gif" height="26" width="26" alt="{l s='Home'}" /></a>{if isset($path) AND $path} <span class="navigation-pipe" {if isset($category) && isset($category->id_category) && $category->id_category == 1}style="display:none;"{/if}>{$navigationPipe|escape:html:'UTF-8'}</span> {if !$path|strpos:'span'} {* Split the path if there's a '>' in it and make right part "strong" *} {if $path|strrpos:'>'} <span class="navigation_page">{substr($path,0,strrpos($path,">")+1)}<strong>{substr($path,strrpos($path,">")+1)}</strong></span> {else}<span class="navigation_page"><strong>{strrpos($path,">")}:{$path}</strong></span> {/if} {else} {* Split the path if there's a '>' in it and make right part "strong" *} {if $path|strrpos:'>'} {substr($path,0,strrpos($path,">")+1)}<strong>{substr($path,strrpos($path,">")+1)}</strong> {else}<strong>{$path}</strong> {/if} {/if}{/if}</div><!-- /Breadcrumb --> (Code from PS 1.5.4.1) What it basically does is, it checks if the path contains a '>' (it searches for the right-most occurrence of it, using strrpos) and if available, it splits the path into a left part (before, and including, the rightmost '>') and a right part, which is made "strong". Hope this helps, pascal Edited May 3, 2013 by PascalVG span class edited back to navigation_page (see edit history) 1 Link to comment Share on other sites More sharing options...
kevin78 Posted May 7, 2013 Author Share Posted May 7, 2013 Hi ! Thanks you very much !! I am on PS 1.4.8 But i think i will find other solution Link to comment Share on other sites More sharing options...
vekia Posted May 7, 2013 Share Posted May 7, 2013 <div class="breadcrumb"> <a href="{$base_dir}" title="{l s='return to'} {l s='Home'}">{l s='Home'}</a>{if isset($path) AND $path}<span class="navigation-pipe">{$navigationPipe|escape:html:'UTF-8'}</span>{if !$path|strpos:'span'}<span class="navigation_page">{$path}</span>{else}{$path}{/if}{/if} </div> just add <strong>{$path}</strong> Link to comment Share on other sites More sharing options...
PascalVG Posted May 8, 2013 Share Posted May 8, 2013 Vekia:That's also possible, but that will make the whole path strong, and the question was only the final 'leaf'. 1 Link to comment Share on other sites More sharing options...
vekia Posted May 8, 2013 Share Posted May 8, 2013 Yup, you've got right, so it will be a bit problematic to use <strong> only for last part of breadcrumb, (in ps 1.4). Maybe something with explode? just explode the $path variable, with separator as navigation pipe... Then we will got an array. Foreach on it and DONE - I'm just thinking ;-) Link to comment Share on other sites More sharing options...
PascalVG Posted May 8, 2013 Share Posted May 8, 2013 Hi Vekia, In my code above, I just search the $path string for the last occurrence of '>' (using strrpos), split up the string and add <strong> to the last part. Works well, I thought :-) Link to comment Share on other sites More sharing options...
PascalVG Posted May 8, 2013 Share Posted May 8, 2013 Hi Kevin, Do you need something different, or is there a problem implementing it?? Link to comment Share on other sites More sharing options...
vekia Posted May 8, 2013 Share Posted May 8, 2013 Hi Vekia, In my code above, I just search the $path string for the last occurrence of '>' (using strrpos), split up the string and add <strong> to the last part. Works well, I thought :-) but your code is for prestashop 1.5.x and unfortunately kevin uses 1.4 - breadcrumb.tpl file looks completly different in 1.4 version Link to comment Share on other sites More sharing options...
PascalVG Posted May 8, 2013 Share Posted May 8, 2013 Ah, that explains... Sorry, didn't check :] On the verge of going to Holland. In three hours my alarm goes off, and then some traveling to do. Probably offline two days. If in the meantime no one got a working answer yet, I'll have a look in the weekend, I hope... That's it for now. Signing off... Pascal Link to comment Share on other sites More sharing options...
kevin78 Posted May 8, 2013 Author Share Posted May 8, 2013 Hi guys I have found the solution here : http://www.prestashop.com/forums/topic/229307-breadcrumb-active-link-for-last-item/page__pid__1212402#entry1212402 Thanks a lot !!! Link to comment Share on other sites More sharing options...
vekia Posted May 8, 2013 Share Posted May 8, 2013 Hi guys I have found the solution here : http://www.prestasho...02#entry1212402 Thanks a lot !!! thanks for share this url, im convinced that it will be really helpfull for other forum members i can go ahead now and mark this thread as solved regards Link to comment Share on other sites More sharing options...
Ron morales Posted June 23, 2014 Share Posted June 23, 2014 (edited) Hi again I'm doing tabs with color, for this I use the <a> tag, I add: nth-child (6n +1) in css style, but I have a problem, the last tab does not end when I have less eyelashes <a> colors do not fit, as I can add in $ path <a>? Edited June 23, 2014 by Ron morales (see edit history) Link to comment Share on other sites More sharing options...
Ron morales Posted July 29, 2014 Share Posted July 29, 2014 No one knows? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now