Hey there, I've noticed that for the microdata http://data-vocabulary.org is being used.
As stated on the data-vocabulary website:
Since June 2011, several major search engines have been collaborating on a new common data vocabulary called schema.org.
The schema.org vocabulary can be used with both Microdata or RDFa 1.1 Lite syntax, and it has types for Event, Organization, Person, Product, Review, AggregateRating, Offer and hundreds of others.
See the schema.org blog for the latest news, and schema.org and FAQ for full details.
Which means that the data-vocabulary.org schema is being deprecated. I took the liberty to patch path_breadcrumbs to use schema.org.
I also changed the structure to be OL>LI (as it's an ordered list of links) and made the seperator optional as this should be implemented in CSS rather then content as its presentational (no seperator selected is no seperator rendered instead of '»').
Lastly I added an option to add a class to the OL indicating the amount of breadcrumbs in the list (breadcrumbs-amount-i)
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | interdiff_7-13.txt | 4.88 KB | shaunole |
| #13 | 2476089-schema-org-support.patch | 6.82 KB | shaunole |
| #8 | After Patch.JPG | 10.67 KB | valery86 |
| #8 | Before Patch.JPG | 10.07 KB | valery86 |
| #7 | path_breadcrumbs-schema_org-support-2476089_6.patch | 4.48 KB | enrico.sato |
Comments
Comment #1
immoreel commentedComment #2
immoreel commentedComment #3
kalabroComment #4
Gml commentedPlease put the separator as a data attribute on the list-item. Then we could add the separator with css in a pseudo element. It doesn't belong in the HTML because it doesn't add semantic value.
Comment #5
sokru commentedI continued from immoreel's patch. If using "microdata",
$metawas not defined and<meta itemprop="position" content="3">was inside link-tag, where it should be next to link.Comment #6
akshaybk0488 commentedHi, I tried with your solution. Its giving me the breadcrumbs for each page but breadcrumb schema is getting applied only for first page. Its not applying for remaining pages. Ex. I am having three links on Home page, so schema breadcrumb is getting applied only for first link.
Comment #7
enrico.sato commentedHi, I created a patch for v3.4. Thanks!
Comment #8
valery86 commentedHi Enrico,
Thanks a lot for the patch, it's really needed to support schema.org!
Just one question, would be possible to have all the breadcrumbs links in the same line? I just noticed that after applying the patch the each link is in a different line and I'd like to have them inline.
I attach a screenshot before & after applying the patch
Thanks in advance!
Comment #9
valery86 commentedHi,
In case someone has the same request, I just kept this line unchanged to have them inline to make it.
$elem_tag = 'span'
Comment #10
valery86 commentedHi,
Today my Google Search Console started to display 2 new Breadcrumbs errors regarding the property item was not set. Just did this small change in the code to get it working
# 'typeof' => 'WebPage',
'property' => 'item',
'typeof' => 'WebPage',
Just in case someone else want to use it...
Comment #11
rdellis87 commentedI applied patch in comment #7.
The breadcrumbs in the page were close to being the same. Visually the only difference I noticed was the space between the delimiter and the next menu item was gone.
Before:
Home » Government » External Agencies » KU Visitor Center
After:
Home »Government »External Agencies »KU Visitor Center
However, the breadcrumbs in the admin menu were no longer inline, but rather on separate lines.
Before:
Home » Administration » Configuration » Regional and language » Date and time
After:
Home»
Administration»
Configuration»
Regional and language»
Date and time
Comment #12
ykoech commentedIs it possible using JSON-LD as an option besides the two? Search engines prefer it over RDFa and Microdata.
https://developers.google.com/search/docs/data-types/breadcrumb
Thank you.
Comment #13
shaunole commentedI've updated the patch from #7 to include support for custom HTML tags. The tags can now be customized in the settings form. Additionally, the delimiter can now be enabled/disabled via a checkbox in the admin in the case that a site wants to use an empty span tag for the delimiter.