Make the menu more accessible

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Yoderman94
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Sat Oct 22, 2011 3:07 pm
Location: NC
Contact:

Make the menu more accessible

Post by Yoderman94 » Mon Nov 07, 2016 7:58 pm

I am trying to make a Joomla menu more accessible. I am using Bootstrap 3 and letting Joomla generate the menu and dropdowns but I need to add ' data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" ' to the top level href among some other aria elements (See example below). However cannot figure out how to use the template overrides to input the information I need. I would prefer not to have to code the menu manually but I will if I have too.

Code: Select all

<ul class="nav  navbar-nav" >
   <li class="dropdown">
      <a href="#" 
         id="toplevelitem" 
         class="dropdown-toggle" 
         data-toggle="dropdown" 
         role="button" 
         aria-haspopup="true" 
         aria-expanded="false"
      >
       Top Level Item
       <span class="caret"></span></a>
       <ul class="dropdown-menu" role="menu" aria-labelledby="toplevelitem">
          <li role="presentation"><a role="menuitem" href="#">Item 1</a></li>
          <li role="presentation"><a role="menuitem" href="#">Item 2</a></li>
          <li role="presentation"><a role="menuitem" href="#">Item 3</a></li>
       </ul>
   </li>
</ul>


User avatar
numinousmedia
Joomla! Ace
Joomla! Ace
Posts: 1567
Joined: Fri Dec 16, 2011 6:13 pm
Location: Barberton, OH
Contact:

Re: Make the menu more accessible

Post by numinousmedia » Mon Nov 07, 2016 10:04 pm

When you say "letting Joomla generate the menu and dropdowns", what do you mean? Generally, the menu is contained in a menu module. Is it the default menu module that you are using? If so, you'd probably want to create a template override for mod_menu to allow you to add those attributes in. Here's documentation on creating those overrides: https://docs.joomla.org/How_to_override ... omla!_core
Ryan
Frontend Developer and Joomla Professional
Ethode Website Development: http://www.ethode.com
Personal Site: http://www.numinousmedia.com

User avatar
CircuitoX
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Sun Oct 25, 2009 10:48 pm
Contact:

Re: Make the menu more accessible

Post by CircuitoX » Mon Nov 07, 2016 10:49 pm

Personally I not like bootstrap, if you wan a responsive dropdown menu for joomla, you can use this (free)

Demo:
http://clickmyweb.net/demos/hmenu/

Tutorial:
https://youtu.be/x193me1ioMo

Download:
http://clickmyweb.net/download
Paginas web en arequipa: http://arequipa.nestormina.com/
Diseño de paginas web en cusco: http://www.nestormina.com

Yoderman94
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Sat Oct 22, 2011 3:07 pm
Location: NC
Contact:

Re: Make the menu more accessible

Post by Yoderman94 » Tue Nov 08, 2016 10:45 am

@numinousmedia I thought my question was more clear than it was. Yes I am using a menu module and as I stated in the original question I cannot figure out how to get the template overrides to work. I have used template overides in the past and have a modifed version I use for every template I built. However this client needs more accesability than I can provide out of the box. Therefore I don't know how or where the href is being created nor how to insert the code I need inline with it. Everything I have tried hasn't worked.


Locked

Return to “Templates for Joomla! 3.x”