Google launches from not long time, a better semantic way to write breadcrumb in html.
It will help google(and other for sure) to better detect and understand content of breadcrumbs.
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/dresses" itemprop="url">
<span itemprop="title">Dresses</span>
</a> ›
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/dresses/real" itemprop="url">
<span itemprop="title">Real Dresses</span>
</a> ›
</div>
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/clothes/dresses/real/green" itemprop="url">
<span itemprop="title">Real Green Dresses</span>
</a>
</div>
I make a patch for 6.x-1.x to display microdata during menu_breadcrumb generation.
I add also a settings page to choose if microdata have to be generate or not.
This patch works if you have only one breadcrumb on the page. For multiple breadcrumbs, microdata syntax is different.
I'll attach patch in next comment to have issue number
Comments
Comment #1
goz commentedHere is the patch (also commited in a branch on git)
Comment #2
goz commentedSomeone to review this patch please ?
Comment #3
xurizaemonThanks GoZ. But I'm afraid I don't see why this is a patch against menu_breadcrumb. Can it not be implemented in the theme layer entirely?
Microdata support sounds great, but I'd think it should either be a separate module (so sites not using menu_breadcrumb can take advantage of it) or implemented in the theme.
I'm happy to hear your thoughts if you do believe this needs to be implemented in this module. Until convinced otherwise, I'm marking this "works as designed".
Comment #4
goz commentedI also think this feature should be in a theme layer.
Unfortunately, drupal 6 doesn't permit to make this once you generate your $breadcrumb[] array (with markup link for example)
On theme_breadcrumb function, we only take $breadcrumbs markup items. The only way to make microdata structure describe on main code example issue at this state is to use regexp (i hope noone do that).
Instead of use this patch (and to make the microdata implementation by theme layer), we could add a theme_menu_breadcrumb_item (overridable by preprocess & .tpl) and let themers override breadcrumb item if they want.
For example, actually we make a breadcrumb item :
So we can make now :
Where theme_menu_breadcrumb_item take title, url, options arguments.
In this case, themer can easily override item with mytheme_preprocess_menu_breadcrumb_item or menu_breadcrumb_item.tpl.php to put his microdata markup.
Does this way is better for you ?
Comment #5
goz commentedSince D7 doesn't improve $breadcrumb to be free of tags, could we work on a solution which will integrate microdata in breadcrumb modules (like describe on #4) ?
I don't think using regexp on template preprocess is a good solution to add microdata compliancy (and it's the only solution for the moment if we don't want to patch your module).