FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Setting up "Breadcrumbs"

Feed 9 posts, 2 voices

Avatar
1493 posts

I see that the MadeByFrog has a lovely "breadcrumb" trail (and I have looked at "page source"! :)

I tried to set this up in the Layout section by including this:

<?php echo $this->breadcrumb(); ?>

Of course, that only gives me the name of the current page -- not a useful "trail". Can anyone (Philippe?:) share their code (even the "div"!) for their breadcrumbs? Thanks!!

David.

 
Avatar
541 posts

of course.. look at this instead :

<?php echo $this->breadcrumbs(); ?>

yes with a "s" at the end ;)

 
Avatar
1493 posts

8^O

That is waaaaay too easy! :) Thanks (again!) Philippe.

 
Avatar
1493 posts

OK - I'm learning! :) I set it up like this:

<?php if ($this->breadcrumb == 'Home') { } else {echo $this->breadcrumbs(); } ?>

Works perfectly. Or is there a better way of doing that?

 
Avatar
541 posts

yes if you need to test a url you can use 2 differents functions the first one is: url_match('the/url') will return true only if the url match exactly the one you asking for "the/url" the other one is url_start_with('/the/url') this one will return true for all other url like /the/url/is/this/one or /the/url/is/this/other/one ...

note too that url are slash trimmed so /the/url = the/url = the/url/ = /the/url/ :)

 
Avatar
1493 posts

Thanks, Philippe - helpful as ever!

Are these uses of "url_match" and "url_start_with" your own creation, or part of the framework? I can't seem to find them in any of the (limited) PHP documentation I have looked at.

David.

 
Avatar
1493 posts

One oddity I just noticed (in 0.8.7) is that the breadcrumb trail set up by the code above looks like this:

http://localhost/frog2//articles/

Any idea why it should be inserting a double // after my "home" directory?

 
Avatar
541 posts

hooo yes I hae my idea :) .. my fault ... did you get the last beta ... I have release again one day after because I have decide to add you the statistique module that I haven add to !! and 3 major bug

for the breadcrumbs I will correct that imidiatly