Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The last breadcrumb on a search results page is not a link, but instead is just plaintext of the search keywords. The adaptive_preprocess_breadcrumb function adds RDF markup at the third character of the breadcrumb. This normally works fine for breadcrumbs since the first three characters are "< a ", but for breadcrumbs that aren't links (search keywords), it adds it into the keyword itself.
This is what I get when searching for "engineering" on my dev site.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1918700.adaptivetheme.breadcrumb_rdf_fix.3.patch | 1.23 KB | jpontani |
#2 | Screen Shot 2013-02-16 at 11.36.44 AM.png | 26.91 KB | jpontani |
#2 | 1918700.adaptivetheme.breadcrumb_rdf_fix.2.patch | 1.23 KB | jpontani |
Screen Shot 2013-02-15 at 6.56.59 PM.png | 11.86 KB | jpontani |
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedRight, this whole idea of inserting rich snippets using string manipulation is a problem, I think we either remove it or find a better way, if possible.
Comment #2
jpontani CreditAttribution: jpontani commentedSo I messed around with a potential fix. I attached it as a patch. It runs a regex on the breadcrumb for any HTML, and takes the outermost HTML element and adds the RDF property to it, and if it's a link element, it adds the rel='v:url' property to it as well.
This is what I get as a result of the patch:
Comment #3
jpontani CreditAttribution: jpontani commentedActually this is the right patch, the first didn't accomodate tags that didn't have a space in them (no attributes on the tag).
Comment #4
ezra-g CreditAttribution: ezra-g commentedComment #5
Jeff Burnz CreditAttribution: Jeff Burnz commentedPatch looks good from here, the acid test will be running with other breadcrumb modifying modules, there is one bug report here : #1910758: Breadcrumbs displaying attributes of the link in the middle of the trail: bug or configuration?
I installed Crumbs and ran it, seems to not be affected like the bug report (after applying this patch), however I am the first one to admit I have no idea what this module is supposed to be doing, the config seems about as intuitive as Windows 8 :/
Comment #6
astutonetThe issue #1910758: Breadcrumbs displaying attributes of the link in the middle of the trail: bug or configuration? was opened for me.
The patch in #3 solves the issue.
Tks.
Comment #7
Jeff Burnz CreditAttribution: Jeff Burnz commentedLooks like I commited this along with updates for the menu toggle (total rewrite), so will call this fixed for now :)