I was visiting g.d.o/jobs today and noticed that the pager links are poorly accessible.

The pager consists of the following code:

      <div class="item-list"><ul class="pager"><li class="pager-previous first">

<a href="/jobs" class="active">‹‹</a>

</li><li class="pager-current">2 of 236</li><li class="pager-next last">

<a href="/jobs?page=2" class="active">››</a>

</li></ul></div>

I am not certain what character is being used as the anchor text for next and previous, but it is not read with JAWS 11 in Firefox 3.6.13. JAWS reads: "link 2 of 236 link".

Comments

greggles’s picture

It was the views "mini pager" which uses a character I believe is called the chevron. It's like <<. I've changed it to a full pager which has that character and the word "first."

If this works for you I'd like to move this issue to the views queue to make the mini pager more accessible. I wonder what we could do to help it and still keep it visually small since it is intended to be used in blocks where space is limited.

Everett Zufelt’s picture

@greggles

Thanks, I took a look with NVDA 2010.1 and JAWS 11 on FF 3.6.13. They both work well with the pager. They both read "Next" for the next link, but do not recognize the special character. I also tested VoiceOver (snow leopard) on Safari 5, which also reads "Next" and ignores the special character. So, this seems like a solution for this issue. But, you are right, it isn't a fix for the mini pager. Would it be appropriate to bump this issue over to the Views queue, or should I open a new issue.

greggles’s picture

Title: Accessibility of /jobs pager links » Views mini pager is not accessible
Project: Groups.drupal.org » Views (for Drupal 7)
Version: 6.x-1.x-dev » 6.x-3.x-dev

Glad to hear it's fixed.

I think it's reasonable to move this issue to the Views queue. I've re-titled it and done so now.

merlinofchaos’s picture

If I understand this right, adding a 'title' => t('Go to the next page') and t('Go to the previous page') to the links would suffice for usability? Jaws would read that, right?

Everett Zufelt’s picture

Status: Active » Postponed

@merlinofchaos

How much I wish I could tell you that you were right. But, sadly assistive tech like JAWS really doesn't respect the title attribute on anchor elements. I'm not sure what the best solution to this issue is.

Preveious / Next is too large for a mini pager, the characters currently used are not recognized by common assistive tech.

Setting to postponed as I research a solution.

mlncn’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Postponed » Active

Having it be text replaced by a CSS background image with the text removed with Drupal's class .element-invisible, or even simply an image with alt text, would seem to be a natural replacement of the non-semantic << and >>.

Everett Zufelt’s picture

+1

dawehner’s picture

Category: bug » task
Issue tags: +Novice

This sounds like a pretty cool task to get into the code

gnuget’s picture

I'm not sure if is necessary add images for replace the ‹‹ and the ›› characters, in accord with the comment #2 the full pager works because read the "next" and ignore the special character.

So should be enough adding the "next" and "previous" words at the mini-pager and add the .element-invisible class for disappear it , isn't it?.

something like:

  <div class="item-list">
    <ul class="pager">
      <li class="pager-previous first">
        <a href="/jobs" class="active">‹‹<span class="element-invisible">Previous</span></a>
      </li>
      <li class="pager-current">2 of 236</li><li class="pager-next last">
        <a href="/jobs?page=2" class="active"><span class="element-invisible">Next</span>››</a>
      </li>
    </ul>
  </div>
gnuget’s picture

Assigned: Unassigned » gnuget

I want to work on this, so i will assign the issue to me.

If all are ok with my solution (about to no add images just add the texts with a class element-invisible) i will upload a patch fixing the issue.

rvilar’s picture

Assigned: gnuget » Unassigned

It's not possible to add HTML code into the link text because views use theme_pager_previous() core function that uses theme_pager_link() and in this function, the last statement is:

return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => $query));

And to use HTML code in this function, we have to attach a new option in l() function array('html' => TRUE), and is not possible to do it.

xeraseth’s picture

I am still very new at this so let me know if either of these ideas is against standards (or just a bad idea).

Wouldn't it be possible to have Views have its own theme_pager functions? Just take core's and tweak it a little bit?

OR

I know it isn't the most elegant solution but perhaps have it have it look like

  <div class="item-list">
    <ul class="pager">
      <li class="pager-previous first">
        <a href="/jobs" class="active">‹‹Previous </a>
      </li>
      <li class="pager-current">2 of 236</li><li class="pager-next last">
        <a href="/jobs?page=2" class="active"> Next››</a>
      </li>
    </ul>
  </div>

and just have a javascript that runs when the page loads and hides the text?

If either of these are viable solutions I wouldn't mind taking on this bug.

dawehner’s picture

Wouldn't it be possible to have Views have its own theme_pager functions? Just take core's and tweak it a little bit?

Well views has it's own for the mini pager already ...

Sure we could add a .js-hide class, though i wouldn't be sure that this would solve all accessibility problems.

Everett Zufelt’s picture

Title: Views mini pager is not accessible » As a screen-reader user I need a way to recognize the purpose of the Next and Previous links in the Views mini pager

I agree with the solutions in #6 and in #9 equally.

#13, you are correct, this would not solve all problems, but this issue is specifically about solving the problem with screen-reader users not recognizing the purpose of the links.

Everett Zufelt’s picture

Views 7.x-3.x has a theme_views_mini_pager() function, but it calls the Core theme_pager_next and theme_pager_previous() functions which subsequently call theme_pager_link(). It is not possible to pass l() arguments to theme_pager_next / previous, since theme_pager_link doesn't use l().

mgifford’s picture

The output suggested in #9 by @gnuget is good. Just not sure how to best get there.
http://api.drupal.org/api/views/theme!theme.inc/function/theme_views_min...

In D8, do we need to expand theme_pager_previous() so it can accept invisible elements?
http://api.drupal.org/api/drupal/includes!pager.inc/function/theme_pager...

dawehner’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Issue tags: +VDC

Push to d8 to fix it there first.

dawehner’s picture

I'm wondering why we can't use the theme previous/next pager but use ::before and ::after to add « and » via these css selectors,
see http://www.w3schools.com/cssref/sel_before.asp ?

aspilicious’s picture

If that works this is a possibility but it isn't supported in IE7, so a no go for Drupal 7.

dawehner’s picture

Ah i see.

One question: would be « previous still be accessible? I guess screenreaders
will ignore this sign, but just asking...

mgifford’s picture

Issue tags: +pagination

From Opera in 2010 (so it may not be relevant) - "current screen readers don't support generated content."

So not sure this will work for screen readers.

Other ideas for D8 pagination:
#115753: Pager rel attributes
#33809: Make pagers not suck

I added this new issue as per my point in #16 above:
#1805678: Expand theme_pager_link() so it can accept html input or specify invisible elements

xjm’s picture

Category: task » bug
Issue tags: -pagination

I think for Drupal 8 removing the character from the source and adding it with CSS is correct. Edit: We replace the HTML characcter with the meaningful word inside .element-invisible and add the visual styling in CSS.

For the backport I guess we'll need to leave the character in the source, but add the meaningful word in .element-invisible. I prefer #9; the fewer images in the base views theming, the better.

Also, this is definitely a bug.

xjm’s picture

Issue tags: +pagination

Sorry, crosspost.

dawehner’s picture

Just link the two issues which has to be solved first before this one: #1805674: Mini pagers should extend full pagers and #1625248: Mini Pager ("tags") are broken

@xjm
In the second issue the users want to be able to switch out the displayed text completely
so i guess the element-invisible idea could have problems.

xjm’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.x-dev
Component: User interface » views.module
mgifford’s picture

There's something definitely broken about the mini-pager. I can only jump back-forth between pages 1 & 2.

In any case, after setting up a mini-pager block I can see this now in D8:

<div class="view view-archive view-id-archive view-display-id-block_1 view-dom-id-9e79c6b47993f8e3ac0eb2b45a970737788d5859e824c6f9920ad64869747660">
<div class="view-content">
<div class="item-list">
<ul class="pager">
<li class="pager-previous odd first">
<a href="/archive/201204">‹‹</a>
</li>
<li class="pager-current even">Page 2</li>
<li class="pager-next odd last"></li>
</ul>
</div>
</div>

The ›› character is still being used.

Certainly no use of <span class="element-invisible">Previous</span>.

dawehner’s picture

You probably have another pager on the same site, so you have to set another pager ID.(see the views settings).

Regarding the character/text, yes that issue is still opened, issues aren't fixed magically :)

mgifford’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

Yup, definitely things aren't fixed magically. I'd kinda hoped that maybe the pagination would just be done by core/includes/pager.inc but I've just borrowed from it for this patch.

There would be a pager on the bottom of the page, but that would be a separate issue.

Status: Needs review » Needs work
Issue tags: -Novice, -Accessibility, -pagination, -VDC

The last submitted patch, views-mini-pager-a11y-1070166-28.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
Issue tags: +Novice, +Accessibility, +pagination, +VDC
mgifford’s picture

StatusFileSize
new213.27 KB

Here's a screen-shot from this patch applied to SimplyTest.me

mgifford’s picture

StatusFileSize
new142.99 KB

Should have added this screenshot too.

Mini-Pager-Title-PreviousNext.png

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Great!

catch’s picture

Status: Reviewed & tested by the community » Needs review

Does this really need to be 'Go to' in both cases or would just 'previous page' / 'next page' be enough?

mgifford’s picture

I'm trying to be consistent with the existing pagination & what we've done with D7. I don't think that the 'Go to' adds much (other than consistency). We could dig into the pagination issue for D7 to find the rationale, but a consistent pattern is more important to me.

Can we put the 'Previous page' / 'Next page' onto a new issue and address it for all pagination in D8?

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
# from pagers.inc
      $titles = array(
        t('« first') => t('Go to first page'),
        t('‹ previous') => t('Go to previous page'),
        t('next ›') => t('Go to next page'),
        t('last »') => t('Go to last page'),
      );

So yeah this is the exact same string, I agree that we should make it consistent first and then improve it later, if useful.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Novice, -Accessibility, -pagination, -VDC

Automatically closed -- issue fixed for 2 weeks with no activity.