? ? Pending

User tests: Successful: Unsuccessful:

avatar hans2103
hans2103
31 May 2020

Pull Request for Issue # .

Summary of Changes

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.

Testing Instructions

  • Make sure you are using mod_menu to display menu items
  • Make sure mod_menu is visible on the frontend
  • Visit a page on your test website
  • Open your browser develop tools and find the output of mod_menu
  • Find the anchor of the current page and see wha

Expected result

<li class="nav-item item-101 default current active"><a href="/index.php" aria-current="page" tabindex="0">Home</a></li>

Actual result

<li class="nav-item item-101 default current active"><a href="/index.php" tabindex="0">Home</a></li>

Documentation Changes Required

Apply the PR and the attribute aria-current with value page will be applied to the frontend menu items pointing to a component.

avatar hans2103 hans2103 - open - 31 May 2020
avatar hans2103 hans2103 - change - 31 May 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 May 2020
Category Modules Front End
avatar brianteeman brianteeman - test_item - 31 May 2020 - Tested successfully
avatar brianteeman
brianteeman - comment - 31 May 2020

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.

avatar richard67 richard67 - test_item - 31 May 2020 - Tested successfully
avatar richard67
richard67 - comment - 31 May 2020

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.

avatar richard67 richard67 - change - 31 May 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 31 May 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29343.

avatar richard67 richard67 - change - 31 May 2020
Labels Added: ? ?
avatar Quy Quy - close - 31 May 2020
avatar Quy Quy - merge - 31 May 2020
avatar Quy Quy - change - 31 May 2020
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
avatar HLeithner
HLeithner - comment - 1 Jun 2020

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.

avatar richard67
richard67 - comment - 1 Jun 2020

@HLeithner Shall I remove RTC?

avatar richard67
richard67 - comment - 1 Jun 2020

@HLeithner Ahh is merged already. What shall we do?

avatar brianteeman
brianteeman - comment - 1 Jun 2020

Could you please point to that discussion

avatar HLeithner
HLeithner - comment - 1 Jun 2020

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

avatar hans2103
hans2103 - comment - 1 Jun 2020

Will dig into it and create a new PR.

avatar brianteeman
brianteeman - comment - 1 Jun 2020

@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

avatar hans2103
hans2103 - comment - 1 Jun 2020

@brianteeman we'll see... I would like to give it a try

avatar hans2103
hans2103 - comment - 1 Jun 2020

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

avatar hans2103
hans2103 - comment - 2 Jun 2020

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?

if ($item->id == $active_id || ($item->type === 'alias' && $itemParams->get('aliasoptions') == $active_id))
{
$class .= ' current';
}

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.

Add a Comment

Login with GitHub to post a comment