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.
theme_breadcrumb() should be converted to HTML5.
1. replace div with nav
2. Add role="nav"
3. move invisible heading inside of the div
4. remove breadcrumb wrapper in page.tpl.php
Comment | File | Size | Author |
---|---|---|---|
#25 | drupal-1347266-25.patch | 4.52 KB | tim.plunkett |
#19 | 1347266-19-html5-breadcrumb.patch | 5.28 KB | JohnAlbin |
#14 | 1347266-theme_breadcrumb-14.patch | 3.06 KB | pcambra |
#12 | 1347266-theme_breadcrumb-12.patch | 3.05 KB | pcambra |
#9 | 1347266-theme_breadcrumb-9.patch | 3.05 KB | Everett Zufelt |
Comments
Comment #1
Everett Zufelt CreditAttribution: Everett Zufelt commented- Removes breadcrumb wrapper from page.tpl.php
- Replaces wrapper with nav instead of div
- Moves invisible heading inside of nav
- Uses ul for breadcrumbs
Comment #2
Everett Zufelt CreditAttribution: Everett Zufelt commentedI don't like where I've added the ul to the end of the heading string. Will re-roll along with any additional feedback.
Comment #4
pcambraTask: Tests need to be modified to match the new html structure of the breadcrumb.
Comment #5
Everett Zufelt CreditAttribution: Everett Zufelt commentedModified menu.test, this should fix most tests.
Comment #7
Everett Zufelt CreditAttribution: Everett Zufelt commented- Fixed the node and book test.
- Ajax multiform tests were failing because id="breadcrumb" is being generated by theme_breadcrumb in the patch from #5. Removed id from <nav>. If this is really required as a theme hook, or for some other reason, we'll need to leave the div wrapper for breadcrumb in page.tpl.php
Comment #9
Everett Zufelt CreditAttribution: Everett Zufelt commentedUpdated tests to use class="breadcrumb" and not id="breadcrumb"
Comment #10
Everett Zufelt CreditAttribution: Everett Zufelt commentedComment #11
pcambraThis is going to fail again for node title, attaching a new patch
Comment #12
pcambraAnother try :)
Comment #13
JacineYou mean role="navigation" :)
Comment #14
pcambraFixed the "navigation" thing
Comment #15
dcrocks CreditAttribution: dcrocks commentedI had a question about using nav for breadcrumbs, as they aren't 'major', but the W3C seems to support it here: dev.w3.org/html5/spec/Overview, section 4.13.2.
Comment #16
Everett Zufelt CreditAttribution: Everett Zufelt commentedThanks all for the help. Looks like we might just need some CSS tweaks and we're done (I won't be doing those).
@dcrocks
Please don't post references to the single page HTML5 spec, it crashes some people's computers (like mine). :)
Comment #17
dcrocks CreditAttribution: dcrocks commentedreally?
Comment #18
pcambraLooking at #16 comment, let's mark this as needs work then and unassign it.
Comment #19
JohnAlbinHere's some CSS cleanup.
Also the
' » '
shouldn't be added to the last breadcrumb.And theme_breadcrumb() should still return a string even if its empty; conditionally returning VOID is bad form.
Lastly, we shouldn't have any
<?php if ($breadcrumb): ?>
in any page.tpl.php files.Comment #20
JohnAlbinIn IRC, people were asking (rightly) about whether » was good for RTL languages. It is. See http://drupal.org/node/179781#comment-610051
Comment #21
JacineTagging for the next sprint.
Comment #22
maartenverbaarschot CreditAttribution: maartenverbaarschot commentedThe list containing the breadcrumbs should really be an <ol> instead of an <ul>.
The order of the breadcrumbs matters.
Comment #23
aspilicious CreditAttribution: aspilicious commentedI thought the only difference between ol and ul was that ol contains number and ul conains shapes. And we hide those anyway.
So I don't know why
<ol>
should be better than<ul>
?Comment #24
Jacine@aspilicious it's not about the bullet style, and technically @maartenverbaarschot is correct, IMO. Here's a little about the difference:
OL spec definition:
UL spec definition:
So... gonna mark needs work unless anyone else has something to say about it. :)
Comment #25
tim.plunkettThat's a really interesting semantic difference, and I kinda like it :)
Changed the ul to ol in the theme function, the CSS, and the tests.
Comment #26
JacineThank you @tim.plunkett! Looks good to me. :)
Comment #27
catchLooks good to me, and I think the
<ol>
is a nice touch here. Committed/pushed to 8.x.Comment #28
AlexBorsody CreditAttribution: AlexBorsody commented$this->assertEqual(current($this->xpath($xpath)), $node->title, 'Node breadcrumb is equal to node title.', 'Node');
should maybe be changed to use t() for the title text.
Comment #29
aspilicious CreditAttribution: aspilicious commentedI don't think it's advised to use t() in tests
Comment #30
oriol_e9gWe don't need t() function in assertions, discussed here: #500866: [META] remove t() from assert message
Comment #31.0
(not verified) CreditAttribution: commentedchanging bradcrumb to breadcrumb, just in case someone is searching