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>
Here's how this sample works:On the first line of each
, indicates that the HTML enclosed in thedescribes a breadbrumb. itemscope indicates that the content of thedescribes an item, and itemtype="http://data-vocabulary.org/Breadcrumb" indicates that the item is a breadcrumb.
The sample describes properties of the item, such as its title and URL. To label properties, each element containing one of these properties (such asor ) is assigned an itemprop attribute indicating a property. For example, .
Each breadcrumb item should appear in order, with the first item representing the top-level page, and the final item representing the parent of the current page.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | microdata-token-notice-1012436-6.patch | 6.01 KB | goz |
| #4 | custom_breadcrumbs_microdata-1012436-4.patch | 5.68 KB | goz |
| #3 | custom_breadcrumbs_microdata-1012436-3.patch | 1.86 KB | goz |
| #2 | custom_breadcrumbs_microdata-1012436-2.patch | 4.87 KB | goz |
Comments
Comment #1
Anonymous (not verified) commentedsubscribe
Comment #2
goz commentedI make a patch for 6.x-1.x to display microdata during custom_breadcrumbs 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.
Comment #3
goz commentedNew patch :
I edit variable's name to get module's name.
I also delete variable in hook_uninstall
Comment #4
goz commentedSorry i'm not very use to git.
So one patch to rule them all.
Comment #5
goz commentedNo-one check this patch ?
Comment #6
goz commentedThere is a notice caused by token because module called token_replace function with array argument instead of $text string.
A new patch resolve this
Comment #7
goz commentedNeeds review
Comment #8
heyyo commentedHi GoZ thanks for your patch !
it seems to be for 6.x-1.x. too bad i'm using 6.x-2.x now :-)
Comment #9
mr.j commentedFor anyone else looking for this, you may as well just do it in your template.php.
eg:
Comment #10
creatile commentedThank you Mr j
Here is my working version for D7
Works with path_breadcrumbs module (But you need to disable the "Use module breadcrumbs render function" in the settings admin/structure/path-breadcrumbs/settings )
Add this in template.php :
Comment #11
gumol commentedcreatile, thank you for your contribution. It works good.
You saved a lot of my time to figure this out! :)
Comment #12
sunward commentedsubscribe
Comment #13
atobis commentedI'm trying to apply the creatile solution (#10) but it does not work.
I'm using Custom Breadcrumbs: 7.x-2.0-beta1 with taxonomy.
Do I have to apply some patch or configuration in addition to the changes in template.php?
Thanks in advance.
Comment #14
summit commentedHi, With latest Custom Breadcrumbs I have the same problem I think as Atobis.
The Item value should be an url, and not a taxonomy like drinks/beer, but http://www.mysite.com/drinks/beer.
Does anybody know how to get this working?
greetings and thanks for your reply in advance, Martijn
Comment #15
lamp5