Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
I've been drinking and figured it would be a good idea to create a new d7 theme ... I was attempting to edit the href attributes for breadcrumbs to add rdf support as outlined at schema.org. The current implementation of menu_get_active_breadcrumb() does not allow for additional attributes to be added to the links it generates.
Proposed resolution
Add another drupal_alter that allows additional manipulation of the links array. This should expose the links to module developers and themers interested in altering the attributes being generated.
Remaining tasks
Needs RTBC and feedback.
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#6 | 1269550-4-breadcrumbs_alter.patch | 1.05 KB | brianV |
#3 | breadcrumbs-alter-1269550-3.patch | 1.04 KB | cyberswat |
#1 | breadcrumbs-alter-1269550-2.patch | 551 bytes | cyberswat |
Comments
Comment #1
cyberswat CreditAttribution: cyberswat commentedComment #2
cyberswat CreditAttribution: cyberswat commentedHere's an alternate version that would likely be more performant by not introducing another drupal_alter but would likely cause others to have to rework their code. Not sure which approach would be better so I present both.
Comment #3
cyberswat CreditAttribution: cyberswat commentedComment #4
brianV CreditAttribution: brianV commented#3: breadcrumbs-alter-1269550-3.patch queued for re-testing.
Comment #6
brianV CreditAttribution: brianV commentedI clicked to re-test before realizing that the paths are now incorrect, and the patch in #3 won't apply. Here's a reroll for testing.
I would go with the latter (single drupal_alter()) version as it's more per formant, and we don't need to worry about too much existing contrib code for D8 yet.