Meta issue: #1980004: [meta] Creating Dream Markup
Heres my dream for the "breadcrumb.twig" file
<nav class="breadcrumb" role="navigation">
<h2 class="element-invisible">{{ 'You are here' | t }}</h2>
<ol>
{% for item in breadcrumb %}
{% if loop.first %}
<li> <a href="{{ item.url }}" title="{{'go to' | t }} : {{item.title}}"><i class="icon-home">{{ item.linktitle }}</i></a> » </li>
{% elseif loop.last %}
<li>{{ item }}: {{item.page.title}}</li>
{% else %}
<li>{{ item }} » </li>
{% endif %}
{% endfor %}
</ol>
</nav>
Markup output
I know it have classes n stuff but that should be easy to add in by the twig template - this is an example of how the markup could look
variation 1
<nav class="breadcrumb" role="navigation">
<h2 class="element-invisible">{{ 'You are here' | t }}</h2>
<ol>
<li><a href="/">Sitename</a></li>
<li><a href="/foo">foo</a></li>
<li><a href="/foo/bar">bar</a></li>
<li><a href="/foo/bar/baz">bar</a> : title of page</li>
</ol>
</nav>
variation 2
<nav class="breadcrumb" role="navigation">
<h2 class="element-invisible">{{ 'You are here' | t }}</h2>
<ol>
<li> <a href="/" title="go to sitename"><i class="icon-home">Sitename</i></a> » </li>
<li><a href="/foo">foo</a> » </li>
<li><a href="/foo/bar" class="stuff-for-fun-here">bar</a> » </li>
<li><a href="/foo/bar/baz">bar</a>: title of page</li>
</ol>
</nav>
Wishes:
{{ item }} must be drillable so we can grap each link and split em down into url, title, linktitle etc
{{item.page.title}} ->i wanna get the title from the page
Comments
Comment #0.0
mortendk commentedUpdated issue summary.
Comment #0.1
mortendk commentedUpdated issue summary.
Comment #0.2
mortendk commentedUpdated issue summary.
Comment #0.3
mortendk commentedUpdated issue summary.
Comment #1
steveoliver commentedyou're dreamin', morten ;) jk. thanks.
Comment #2
jptarantoI have an issue with the use of the h2 as a heading for the nav block.
Some reference: http://accessibility.psu.edu/headingshtml (i just found that with a google, but it summarises the gist).
There is also the website achecker.ca which will scan HTML and return errors with h2 tags.
In summary: Heading's are meant to be used only for page/article content and are not meant to represent headings of blocks, etc.
This is probably something that would effect quite a few templates and I know its a convention that's been used in drupal for awhile now. But it is something we have had to struggle with when building WCAG 2 (government sites), actually dupe'ing core tpl files then editing them just to swap out the element-invisible h2's with spans or divs.
So lets start the conversation and see if this is important enough to do something about.
Comment #3
mortendk commenteddude dont change the title :)
Comment #4
jptarantowoops
Comment #5
mortendk commentedsecond take on this
h2 is out an a span is in instead
Markup output
I know it have classes n stuff but that should be easy to add in by the twig template - this is an example of how the markup could look
variation 1
variation 2
Wishes:
{{ item }} must be drillable so we can grap each link and split em down into url, title, linktitle etc
{{item.page.title}} ->i wanna get the title from the page
Comment #6
mortendk commentedComment #7
jptarantosick biccies. Looks awesome.
We should keep an eye out for this elsewhere too cause i know it appears in other nav's (main menu, etc) and possibly other places too.
Comment #8
crizGreat, my dream markup would also follow right indentations and would have no whitespaces:
Last time I tested this it didn't really work (see http://drupal.org/node/1849440), but this should theoretically fix at least identations:
More about this in the twig coding standards section: http://drupal.org/node/1823416 But don't know how we should proceed with this...
Comment #8.0
crizUpdated issue summary.
Comment #9
sierkje commentedComment #10
greg boggsCurrent breadcrumb markup on grandchild page:
Current page title: Grand Child Page
URL: http://localhost/drupal/node/2
Output: Home » child page
<nav role="navigation" class="breadcrumb"><h2 class="element-invisible">You are here</h2><ol><li><a href="/drupal/">Home</a></li><li><a href="/drupal/node/1">child page</a></li></ol></nav>Comment #11
star-szrDuplicate of #1982214: Markup for: theme_breadcrumb() I think.
Comment #11.0
star-szrMeta issue added.