Beside #868972: summary attribute for tables what can be done to improve the output of views.

Some suggestions i think could help:

  • Add a way to manually add id/scope attribute to the header
  • Add a way to manually add scope attribute to the table output
  • Adding a caption textfield to the table?
  • Even <td headers="step jenny birthday">Feb 12</td> could be perhaps made possible if you allow tokens to use

See http://webaim.org/techniques/tables/data

Please tell what you think about this suggestions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mgifford’s picture

There are some issues here that are mentioned that are useful:

#716310: Views Accessibility

Given the amount that content is reloaded on the page however I do think we should think carefully about adapting WAI-ARIA to pass along more meaning to the browser.

mgifford’s picture

mgifford’s picture

FileSize
109.66 KB

There is a lot of text that doesn't have sufficient definition associated with it to allow a screen reader to understand context:

http://www.w3.org/TR/2007/WD-WCAG20-TECHS-20070517/Overview.html#F63

EDIT: The screen capture included here provides the view WebAim's WAVE tool provides of the admin page with lots of yellow links to all of the redundant text to Edit/View links. WebAIM has a nice firefox plugin that really helps evaluate admin areas of web pages that you don't want to make public.

mgifford’s picture

FileSize
28 KB

There are missing labels in form elements like the display select list here.

EDIT: A select dropdown for Views. WebAIM is again marking it up as a form without an associated label.

Everett Zufelt’s picture

Glad to see interest and effort going into Views accessibility. It would be helpful to me, if not others like MerlinOfChaos, if we could have a bit more clarity about problems and solutions without only linking to an external resource. It would be particularly helpful, since we're on the topic of accessibility, if we could provide some type of textual description of screen-shots, as I currently have absolutely no idea what is being discussed.

If this is an accessibility barrier then this can likely be marked as a bug.

Thanks

mgifford’s picture

Thanks for commenting here Everett. Sorry for not providing descriptions of the screen captures. I often neglect them just for lack of time, sorry. I'll edit the thread above and list them.

Another error to mention here is that there are blank header tags being output from Views. In general it's bad form to send empty tags to the browser, but especially with headings & links.

esmerel’s picture

Issue tags: +Accessibility

adding tag

Sheldon_Parnes’s picture

This looks like a set of solutions in search of a problem. It looks like the author wants to add additional data or new methods of adding data to objects but never really explains what the benefits are. I am echoing Everett Zufelt here.

I would also push this to 7.x or postpone do to the lack of activity on this issue.

mgifford’s picture

I'm fine with this going into 7.x, but at the time development was done on 6.x & then forwarded. I'm working on the 7.x-3.0-rc1. I've done just some evaluation with the WAVE Firefox Toolbar.

Looking at popular/today the HTML output presently looks like:

      <table class="views-table cols-4">

    <thead>
    <tr>
              <th class="views-field views-field-type">
          Type        </th>
              <th class="views-field views-field-title">
          Title        </th>
              <th class="views-field views-field-name">
          Author        </th>

              <th class="views-field views-field-daycount">
          Views today        </th>
          </tr>
  </thead>

I don't see how to manipulate the headers with Vies in order to follow the best practices outlined by http://webaim.org/techniques/tables/data

Everett Zufelt’s picture

OT @Sheldon_Parnes

I would be careful "echoing" someone who 1. doesn't have a clue who you are, and 2. might not agree with what you are "echoing".

mgifford’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Active » Closed (duplicate)
mgifford’s picture

Issue summary: View changes
Status: Closed (duplicate) » Needs review
FileSize
2.73 KB

Simple back-port of improvement in Views D8 Core #864006: Improve table semantics by adding scope or headers/id attributes. Does not include Grid. Since it's a different project, simply re-opening this issue.

dawehner’s picture

Can we try to avoid that much logic in templates?

mgifford’s picture

Would be neater to combine print 'class="'. $header_classes[$field] & print 'id="'. $header_id[$field] in a common variable...

Is this more of what you are looking for? It's definitely messy as it is in the patch in #12.

Chris Matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

The 5 year old patch in #12 to theme.inc and views-view-table.tpl.php does not apply to the latest views 7.x-3.x-dev.

Checking patch theme/theme.inc...
error: while searching for:
        if ($element_label_type) {
          $vars['header'][$field] = '<' . $element_label_type . '>' . $vars['header'][$field] . '</' . $element_label_type . '>';
        }
      }

    }

error: patch failed: theme/theme.inc:547
error: theme/theme.inc: patch does not apply
Checking patch theme/views-view-table.tpl.php...
error: while searching for:
    <thead>
      <tr>
        <?php foreach ($header as $field => $label): ?>
          <th <?php if ($header_classes[$field]) { print 'class="'. $header_classes[$field] . '" '; } ?>>
            <?php print $label; ?>
          </th>
        <?php endforeach; ?>

error: patch failed: theme/views-view-table.tpl.php:27
error: theme/views-view-table.tpl.php: patch does not apply
Andrew Answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.66 KB

Patch rerolled.

Andrew Answer’s picture

Andrew Answer’s picture

Patch rerolled/fixed after last commits.