There should be a header at the top of the list elements for the node links in the node.tpl.php

      <div class="node-links">
        <h2 class="element-invisible">Node Links</a>
        <?php print render($content['links']); ?>
      </div>

As per http://www.w3.org/TR/2010/NOTE-WCAG20-TECHS-20101014/H80

Comments

Jeff Burnz’s picture

Category: feature » bug

I always struggle with what text to use for this heading which may be why there isn't one at the moment, I used to call them "Action links" but even that is wrong, don't want to use the "n word" here, any other suggestions?

Everett Zufelt’s picture

Hmmm...

Please do not use the "n" ... "ode" word.

It is tremendously difficult to come up with a heading for these links, as * anything * can find its way into this list of links. Are there any good words that might best describe the relationship, generally, between the links and the content with which they are associated?

As a thought experiment we can ponder the ARIA roles model "contentinfo" http://www.w3.org/TR/wai-aria/roles#contentinfo which, on first thought in the middle of the night, seems appropriate. Is there a way that we can create a meaningful heading from the semantics of this role?

Everett Zufelt’s picture

Title: Adding Heading to Unordered List Items » Adding Heading to node links, Unordered List Items

updating title

Jeff Burnz’s picture

Possibly a literal "Content Links"?

Everett Zufelt’s picture

@Jeff

That was the best idea that I have been able to come up with so far, but it's still the middle of the night :)

We do run into the stupid nesting headings problem based on context of the content.

As a single node view h1 for title and h2 for local tasks headings and "content links" headings is good.

However, in a list as on the default front page we end up, usually, with h2 for title and h2 for content links. Is it possible to make the "content links" heading single node view aware and to adjust the heading level accordingly? I would guess not since there really, afaik, is no way for the tpl file to know anything about its context other than if this is currently the front page.

We really need to come up with a better solution to this problem generally in D8.

Jeff Burnz’s picture

Heading levels are way less of a problem in HTML5, I am going to make node titles H1 all the time, we use the other sectioning elements as they are more powerful, so we can make the links heading H2 with impunity, no problems there.

BTW guys I just downloaded the 7.x-2.x archive and this is not the HTML5 code its supposed to be, I think something has gone wrong with CVS, I'll wait until after the Git Migration tomorrow before doing anything about it. Grrrr....

mgifford’s picture

Hopefully the git migration tomorrow is smooth. We haven't dug the archive yet, but good to be told it's not the HTML5 code we were looking for.

I do think that this fits nicely within the contentinfo WAI-ARIA role

A large perceivable region that contains information about the parent document.

Examples of information included in this region of the page are copyrights and links to privacy statements.

User agents SHOULD treat elements with the role of contentinfo as navigational landmarks.

Within any document or application, the author SHOULD mark no more than one element with the contentinfo role.

This does seem to fit most situations, but not those displaying a list of nodes.

If we can march ahead with better HTML5 & WAI-ARIA support then maybe we don't need to mess around with the invisible H2 heading.

Failing that a hidden "Content Links" header would work just fine.

Jeff Burnz’s picture

I don't think we should use the actual role on links, since we can only use it once per page it needs to be on the page footer. Some themes are marking up links as <footer> which is probably OK, but really <footer> is for meta data such as author, date etc.

Regarding no invisible headings - not really sure about that, it will most likely depend on how screen reader software decides to support HTML5, for example if they can make use of the <nav> element or even role="navigation", so really it will depend on what our alternatives are.

Everett Zufelt’s picture

I don't think we should use the ARIA role quite yet either. But, to clarify...

The contentinfo role is to be used once per document or application region. Therefore a frontpage w/ 10 nodes (documents) listed could have 11 contentinfo regions. 1 for the main page, one for each child document. Just keep reading the part of the spec after what Mike had quoted.

Jeff Burnz’s picture

Don't agree Everett. Nodes are not application, they are article which is a subclass role of document. The spec says once per document, nodes are part of the document. Additionally it does not make sense to overwhelm AT with roles, a chief complaint of my earlier use of ARIA Roles in my themes, too many roles does not help according to user feedback, its better to have fewer more well targeted roles. Would having contentinfo on every nodes links really help? I don't think so.

Note: Because document and application elements can be nested in the DOM, they may have multiple contentinfo elements as DOM descendants, assuming each of those is associated with different document nodes, either by a DOM nesting (e.g., document within document) or by use of the aria-owns attribute.

I don't see how a list of nodes (as in Drupal nodes) passes as document within document, i.e. a Drupal node is not going to carry role="document", and in fact if we dig deeper into the spec we find...

Authors SHOULD set the role of document on the element that encompasses the entire document. If the document role applies to the entire web page, authors SHOULD set the role of document on the root node for content, such as the body element in HTML or svg element in SVG.

role="document" is going to be set on the root element, in HTML5 that is going to be <html>, so once per "document" really means what it says - once per page.

FYI Everett I have read the spec, many times, and keep up with changes, please do not assume I have not done this or that simply because I disagree with you.

Everett Zufelt’s picture

Wow...

I assume that everyone either hasn't read the spec or, like myself, has forgotten what they have read. I offered an interpretation.

Clearly it's your theme, so you can make your own decisions, I'm just offering a perspective.

Jeff Burnz’s picture

Sorry Everett, I didn't mean to be rude or obtuse, my apologies if I was in any way, I really do value and appreciate you taking the time to offer your opinion and views. Sorry, I got a bit miffed at being pointed to the spec, I do read them, a lot (however boring they are) and try to interpret them best I can- now I'm not saying that I am right, but from what I read thats the way I interpret it, and I think from experience we should limit roles in the page and not splash them about perhaps like RDFa is, I want to add value to the document, but I am cautious about adding too many roles or those that might have only partial relevance. If we were to use contentinfo in nodes there is no way I would add it to links, it would be added to submitted information.

mgifford’s picture

First, I posted a link & question on this to twitter & asked for john foliot's input. He's the most involved HTML5 accessibility guy I know, and figured he'd have some ideas. Thought I'd summarize his response to @mgifford & @ezufelt:

After looking at that, my first thought was to use role=menu on the div today and menu element in html5 as it strikes me that *any* list of nothing but links is, by nature & design, a menu however, the question then becomes, does this menu need to be better labeled/identified, and if yes, how? If the visual label of the h2 is disappeared via CSS, then do non-visual users need that extra info too? I don't know...

I have to clarify this a bit & had to really combine the threads in the conversation a bunch.

So if we were going to go with this approach we'd need to wrap this in a menu element. So would this be just:

  <menu class="node-links">
      <?php print render($content['links']); ?>
   </menu>

If so, is there room/need for the "Content Links" description?

mgifford’s picture

I also wanted to chip in about the discussion about standards & interpretation of the standards. I hate reading standards, and skim more than I should. Often I have to read & re-read them, then don't quite have what I need/want to know confidently how to implement it. There really aren't enough practical examples of real-life situations that are well documented and scanning through hundreds of pages of requirements often isn't going to give you a conclusive answer.

Jeff, this is definitely your theme. You've also shown a commitment to accessibility in D7 and know this is an issue your motivated by. I posted in the text of the contentinfo description from WAI-ARIA just so that it would be there to refer to to see if it makes sense (for my benefit if nobody elses). I really don't know what the right approach is for implementing this type of list of content related links.

I do know though that we need to approach this experimentally & move ahead with people who use AT. I know that what is implemented here will affect discussions around D8, HTML5 & ARIA implementations. I also know that there are other folks who are struggling to figure out the best approach that deals with both the latest versions of AT & the critical mass that most folks are using.

How many roles are too many? What other options should be considered? Are there other potential code samples we can look at to evaluate if they would be an enhancement or not? How many lists of links does a given drupal site tend to have and how do we best manage navigation between them?

Jeff Burnz’s picture

Hmmm, menu is a very interesting approach and one I am more favorable towards, I'm not so familiar with this element and will look into it, from what I can tell it can take two attributes - type and label, label is meant to generate a visible heading. I'm going to read more about this, I think it most certainly looks like very strong candidate.

How many lists of links does a given drupal site tend to have and how do we best manage navigation between them?

This is a very difficult question and one I have thought about a lot over the past few months, especially with all the new elements we have at our disposal in HTML5. Too bigger question for here but one we will need to answer in due course.

mducharme’s picture

This may be a bit short-sighted considering the lengthy discussion but how about using "Related Links" as the title in this case. Generic yet informative enough?

mgifford’s picture

So I'd say that in looking tat these:
http://html5doctor.com/nav-element/
http://www.ibm.com/developerworks/library/x-html5/
http://stackoverflow.com/questions/4969801/nav-or-menu-html5

Menu isn't a good option.

Not sure how to make any progress on this though.