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

mortendk’s picture

Issue summary: View changes

Updated issue summary.

mortendk’s picture

Issue summary: View changes

Updated issue summary.

mortendk’s picture

Issue summary: View changes

Updated issue summary.

mortendk’s picture

Issue summary: View changes

Updated issue summary.

steveoliver’s picture

Issue tags: -#dreammarkup

you're dreamin', morten ;) jk. thanks.

jptaranto’s picture

Title: breadcrump markup & twig file » Accesibility calls
Issue tags: +#dreammarkup

I 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.

mortendk’s picture

Title: Accesibility calls » breadcrumb markup & twig file

dude dont change the title :)

jptaranto’s picture

woops

mortendk’s picture

second take on this
h2 is out an a span is in instead

<nav class="breadcrumb" role="navigation">
  <span class="element-invisible">{{ 'You are here' | t }}</span>
  <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">
  <span class="element-invisible">{{ 'You are here' | t }}</span>
  <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">
  <span class="element-invisible">{{ 'You are here' | t }}</span>
  <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

mortendk’s picture

Issue tags: -#dreammarkup +dreammarkup
jptaranto’s picture

Issue tags: -dreammarkup +#dreammarkup

sick 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.

criz’s picture

Great, my dream markup would also follow right indentations and would have no whitespaces:

<nav class="breadcrumb" role="navigation">
  <span class="element-invisible">{{ 'You are here' | t }}</span>
  <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>

Last time I tested this it didn't really work (see http://drupal.org/node/1849440), but this should theoretically fix at least identations:

<nav class="breadcrumb" role="navigation">
  <span class="element-invisible">{{ 'You are here' | t }}</span>
  <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>

More about this in the twig coding standards section: http://drupal.org/node/1823416 But don't know how we should proceed with this...

criz’s picture

Issue summary: View changes

Updated issue summary.

sierkje’s picture

Issue tags: -#dreammarkup +dreammarkup
greg boggs’s picture

Current 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>

star-szr’s picture

Status: Active » Closed (duplicate)
star-szr’s picture

Issue summary: View changes

Meta issue added.

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 1750250)