User tests: Successful: Unsuccessful:
Pull Request for Issue # .
add attribute aria-current="page"
to frontend module mod_menu to the menu item that is the current page.
Screen readers should announce "Current page" to indicate the link with aria-current="page"
is link is the current page in the navigation.
<li class="nav-item item-101 default current active"><a href="/index.php" aria-current="page" tabindex="0">Home</a></li>
<li class="nav-item item-101 default current active"><a href="/index.php" tabindex="0">Home</a></li>
Apply the PR and the attribute aria-current
with value page
will be applied to the frontend menu items pointing to a component.
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Front End |
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-05-31 19:13:28 |
Closed_By | ⇒ | Quy | |
Labels |
IIRC we had a discussion about this because it's basically wrong, the menu item is not necessary the current page, example every article in a category which has not a menu item assigned would be wrong.
@HLeithner Shall I remove RTC?
@HLeithner Ahh is merged already. What shall we do?
Could you please point to that discussion
I tried to find it but failed...
But basically current="page" should reflect the current page link bu this promise couldn't be fulfilled by mod_menu at least not with a simple $Item_id === $active_id
Will dig into it and create a new PR.
@hans2103 I dont believe it is really solvable unless you remove the aria-current from the menu item when you are not on its initial page and I dont think we have the ability to test for that. Its the same "problem" as when people dont want modules to display on the article page but do on the category blog
@brianteeman we'll see... I would like to give it a try
Since this pull request already been merged, I have created a new pull request to solve the issue mentioned in #29343 (comment)
I would like to suggest to close this issue and proceed with the newly created PR #29369
correct me if I'm wrong.. if the currently merged solution aria-current="page"
is open for improvement, so is the existing code which adds a the class current
. Is that piece of code open for improvement too?
joomla-cms/modules/mod_menu/tmpl/default.php
Lines 38 to 41 in 5a7ff7d
If so... we have to extend the MenuHelper with a function that finds out if the menu item is indeed the current page. And not only for an opened item in category blog, also for other components.
I will copy this comment to #29369 to so we can continue the discussion over there.
I have tested this item✅ successfully on a0896f0
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29343.