Coming from #1912604: Convert theme_views_mini_pager to twig

Mini pager has no visually-hidden 'Pages' markup like the full pager does.

CommentFileSizeAuthor
#9 2058279-mini_pager_a11y-9.patch404 bytesmondrake
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Category: feature » task
Issue tags: +Novice, +VDC

All you need is to copy the default pager twig output to the mini pager one.

mondrake’s picture

Issue tags: +a11y

tagging

mondrake’s picture

Issue tags: +Accessibility

tagging

Liam Morland’s picture

Issue tags: -a11y

Remove obsolete tag.

star-szr’s picture

Title: Align mini pager accessibility markup to full pager. » Remove views-mini-pager.html.twig, use a pager theme suggestion instead

I think we should make this a sub-issue of #1804614: [meta] Consolidate theme functions and properly use theme suggestions in core, and just make the mini pager a theme suggestion of the default pager.

Like '#theme' => 'pager__mini_pager' or similar. If the markup is identical no point in having two.

So re-structuring this issue to do that.

star-szr’s picture

Status: Active » Postponed

However… we can't have a separate preprocess function for the mini pager until some work on #2004872: [meta] Theme system architecture changes is resolved (new theme suggestions hook and hook_theme_prepare() phase).

I'd prefer to postpone this issue rather than have two identical Twig templates but anyone is welcome to disagree :)

mondrake’s picture

IMHO, we should keep decoupled the accessibility discussion from the consolidation opportunity, as per the comment #57 in #1912604: Convert theme_views_mini_pager to twig.

I am not objecting to your points @Cottser, just believe it should be a separate issue.

I am not reverting anything here as I see this issue has been referenced in a meta.

star-szr’s picture

Title: Remove views-mini-pager.html.twig, use a pager theme suggestion instead » Align mini pager accessibility markup to full pager.
Status: Postponed » Active

Sure, no problem. Reverting the changes here and created #2076301: Remove views-mini-pager.html.twig, use a pager theme suggestion instead.

star-szr’s picture

Issue summary: View changes

Add meta issue to summary

mondrake’s picture

So, here's a patch.

This makes core/modules/views/templates/views-mini-pager.html.twig identical to core/modules/system/templates/pager.html.twig , in line with the issue summary and comment #1.

I am not sure this is OK from a pure accessibility POV though, hence review is needed.

A 'full' pager is rendered as:

« first ‹ previous 1 2 3 4 5 6 next › last »

a 'mini' pager (called from within a view with view's default link labels) as:

‹ previous Page 4 next ›

mondrake’s picture

Status: Active » Needs review

... and status change ...

dawehner’s picture

Adding tag, but I guess this is just fine.

mgifford’s picture

I've just looked at the code, but seems it's just adding to a list:
<h2 class="visually-hidden">Pages</h2>

So that looks good to me to provide additional context for Assistive Tech users.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

It is the same code as the normal pager so +1

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 7d07ce0 and pushed to 8.x. Thanks!

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

Anonymous’s picture

Issue summary: View changes

Revert change to summary