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".
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | Mini-Pager-Title-PreviousNext.png | 142.99 KB | mgifford |
| #31 | Mini-Pager-Title.png | 213.27 KB | mgifford |
| #28 | views-mini-pager-a11y-1070166-28.patch | 1 KB | mgifford |
Comments
Comment #1
gregglesIt 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.
Comment #2
Everett Zufelt commented@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.
Comment #3
gregglesGlad 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.
Comment #4
merlinofchaos commentedIf 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?
Comment #5
Everett Zufelt commented@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.
Comment #6
mlncn commentedHaving 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 >>.
Comment #7
Everett Zufelt commented+1
Comment #8
dawehnerThis sounds like a pretty cool task to get into the code
Comment #9
gnugetI'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:
Comment #10
gnugetI 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.
Comment #11
rvilarIt'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:
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.
Comment #12
xeraseth commentedI 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
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.
Comment #13
dawehnerWell 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.
Comment #14
Everett Zufelt commentedI 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.
Comment #15
Everett Zufelt commentedViews 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().
Comment #16
mgiffordThe 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...
Comment #17
dawehnerPush to d8 to fix it there first.
Comment #18
dawehnerI'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 ?
Comment #19
aspilicious commentedIf that works this is a possibility but it isn't supported in IE7, so a no go for Drupal 7.
Comment #20
dawehnerAh i see.
One question: would be « previous still be accessible? I guess screenreaders
will ignore this sign, but just asking...
Comment #21
mgiffordFrom 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
Comment #22
xjmI 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-invisibleand 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.
Comment #23
xjmSorry, crosspost.
Comment #24
dawehnerJust 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.
Comment #25
xjmComment #26
mgiffordThere'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:
The ›› character is still being used.
Certainly no use of
<span class="element-invisible">Previous</span>.Comment #27
dawehnerYou 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 :)
Comment #28
mgiffordYup, 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.
Comment #30
dawehner#28: views-mini-pager-a11y-1070166-28.patch queued for re-testing.
Comment #31
mgiffordHere's a screen-shot from this patch applied to SimplyTest.me
Comment #32
mgiffordShould have added this screenshot too.
Comment #33
dawehnerGreat!
Comment #34
catchDoes this really need to be 'Go to' in both cases or would just 'previous page' / 'next page' be enough?
Comment #35
mgiffordI'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?
Comment #36
dawehnerSo yeah this is the exact same string, I agree that we should make it consistent first and then improve it later, if useful.
Comment #37
dries commentedCommitted to 8.x. Thanks.