Here for the community? On May 9th, we'll be in New Orleans. Don’t miss out!
Coming from #1912604: Convert theme_views_mini_pager to twig
Mini pager has no visually-hidden 'Pages' markup like the full pager does.
All you need is to copy the default pager twig output to the mini pager one.
Remove obsolete tag.
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.
'#theme' => 'pager__mini_pager'
So re-structuring this issue to do that.
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 :)
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.
Sure, no problem. Reverting the changes here and created #2076301: Remove views-mini-pager.html.twig, use a pager theme suggestion instead.
Add meta issue to summary
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 ›
... and status change ...
Adding tag, but I guess this is just fine.
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.
It is the same code as the normal pager so +1
Committed 7d07ce0 and pushed to 8.x. Thanks!
Automatically closed -- issue fixed for 2 weeks with no activity.
Revert change to summary
Drupal is a registered trademark of Dries Buytaert.