I haven’t used any other breadcrumb plugins, so I don’t have anything to compare yours against. One thing you should do is to tell what you mean by a breadcrumb and what will be displayed when you make the function call.
I would describe it as a visual display of the path you took to get to where you are on the blog. If you do a search on a blog, it will show you that you did a search to get to where you are. If you select a sub-category, it will show you the category hierarchy.
Why did you want such a breadcrumb display?
Thread Starter
wyrd33
(@wyrd33)
An update: I made the breadcrumb filter based. You can now highly customize it to your needs, and other plugins can extend the breadcrumb with ease. Further information at http://www.thedevproject.com/projects/wordpress-breadcrumb-plugin/
In response to above:
I like breadcrumbs because they offer better navigation when the user is deep within your site.
I don’t think “breadcrumb” really needs any explanation. Every other CMS offers breadcrumb support, so it’s a pretty widely used term.
Parent pages are displaying backwards, for me at least. You seem to be using “rsort”, which sorts an array highest-to-lowest by key, with “array_reverse”, which simply reverses an array top-to-bottom.
Change line 159:
rsort($parents);
to:
$parents = array_reverse($parents);
Dunno if this applies to categories and the other sections as well, I’ve only tested with pages.
Thread Starter
wyrd33
(@wyrd33)
Ah thank you sir. Fixed. rsort worked fine, it was just that I forgot to assign the return value. Silly me. 😉 Just to be safe, I also changed rsort to array_reverse.
I like it.
I do have one feature request though. Could it be possible to add an extra parameter to easily mark the current location in the crumb path? (Which would be the last one.)
Something like this:
breadcrumb(“”, “[li]”, “[/li]”, “[li class=\”selected\”]”);
And something entirely different. What do you use to display those code snippets on your page?
Thread Starter
wyrd33
(@wyrd33)
Nazgul:
I can probly swing that feature, sure. Sounds like it’d be a useful one.
The syntax highlighting are from a GeSHi plugin that I made. GeSHi is a free syntax highlighter (found here: http://qbnz.com/highlighter/ ) and I simply plugged it into WordPress. I’ve had to fight endlessly with the way WordPress filters page content, though, and I’ve also had to turn off their fancy editor.
The plugin isn’t anything special, I do believe there are quite a few syntax highlight plugins already available in the plugin directory on this site.
Thread Starter
wyrd33
(@wyrd33)
Alright, I went ahead and added your feature request, another crumb (for paging), and fixed a few bugs. Version is now 0.4:
Added current page crumb, added text before current crumb (users location) option, fixed home page crumb while paging, fixed 404 crumb, fixed month link, fixed day link.
Feel free to hit me with any other feature requests that you might have.
Thanks!
I just updated the one on my blog to version 0.4.
I’ve made a small alteration though, because I’d like all items in the crumbs to be links, including the current one. But if you want to include that feature in the official plugin I think it should be configurable.
what’s breadcrumb? can you provide a link with a demo to see it on action?
Thread Starter
wyrd33
(@wyrd33)
A breadcrumb is a form of navigation that leads from the current users location back to your home page URL. For example:
Home > Projects > Blackjack
or
Home > Search > PHP > Page 2
That’s a breadcrumb. It’s useful for larger sites that have deeply nested pages. You can see examples of it on my web site and also Nazgul’s web site. Although Nazgul’s is harder to spot, because he did something very nifty with his. 🙂
Figure I would post in the plugins thread to unclutter the other thread.
Thanks for this plugin first off. I had been using multiple category templates to get the same effect as a breadcrumb.
Also regarding the title. I found that using link_none with it’s option set to false more flexible than using breadcrumb_title. Just more options to tweak it are available than using just the title one.
Features I would like to see. My biggest want is for an option to have the first page to never show as Page 1. Or if there is only one page.
Well really that is my only feature request. But I would like for you to explain the filters some more. I understand it a little bit. I was able to add the word Search into the breadcrumb like I had asked in that other thread.
I don’t understand how to add filters for pages not directly in wordpress. For example I use a separate php script for my polls. How would get those pages into the breadcrumb? And how would I integrate other plugins into the breadcrumb?
Thanks again for a great plugin.
Thread Starter
wyrd33
(@wyrd33)
When I get some time, I’ll try and put some better filter examples up on my blog. Until then, check out the WordPress codex for how to use filters. That might shed some light on things.
Here is a bug maybe.
http://www.hotelblues.com/index.php?s=Test shows Test in the title.
http://www.hotelblues.com/search/Test does not show Test in the title.
I can confirm that.
Both get_breadcrumb_search_phrase and get_breadcrumb_search_uri return an empty string, because in this situation the $_GET[“s”] isn’t set.
This seems pretty cool, I’ll try it when I get a chance.