Greetings,

Many bootstrap themes call for the active class in the LI element as opposed to Drupal's default A element. I was wondering if you could enhance the radix_menu_link function to make it possible to add a class for the LI element as well? Thanks for the great theme. kevin

Comments

shadcn’s picture

Status: Active » Fixed
pyxio’s picture

Hi arshadcn,

Thanks for the fast and perfect fix. menu.inc is a very clean and bootstrap friendly implementation of the Drupal menu. Users don't even have to muck around with contributed modules like superfish and nice menus. the only thing i would say that is missing yet is short title link descriptions commonly seen in bootstrap menus. I have this working but surely my code would not be as elegant as yours. If you are keen on integrating it into radix for others I currently have something to this effect...

// Add link description below link title
//if ($element['#original_link']['menu_name'] == "main-menu"){
//$element['#title'] .= ''.$element['#localized_options']['attributes']['title'].'';
//}

note, //$element['#localized_options']['html'] = TRUE; needs to be added at the top of the function to ensure the description is wrapped in span tags.

Also note, this code does throw some undefined index notices in the current state above.

Thanks for everything. Kevin

Status: Fixed » Closed (fixed)

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

pyxio’s picture

Hi,

Should this menu.inc update be adding an active class to the primary menu

  • element as well as the nested
  • element in a dropdown menu? I am having trouble getting the top level
  • element of an active submenu item to also be active. The active class should actually look like..
    <ul class="nav">
      <li>..</li>
      <li>..</li>
      <li class="active">..</li>
      <li>..</li>
    </ul>
    

    but now is appearing like:

    <ul class="nav">
      <li>..</li>
      <li>..</li>
        <a href="#">
          <ul> 
              <li>..</li>     
              <li class="active">..</li>
      <li>..</li>
    </ul>
    

    dunno if I did anything wrong or if it currently does not put an active class at the top level. let me know. Thanks!!

  • pyxio’s picture

    i should clarify.. top level pages show the active li class just fine. but when clicking on a page in a submenu, the primary menu active class is lost.

    pyxio’s picture

    Hi

    Can you please take a look at my menu.inc file here http://pastebin.com/tuFvCQ2W. My top level active LI should have the class current-menu-parent but the class is not being added. Please let me know if there is a mistake in my menu.inc. I appreciate it thanks. Kevin

    pyxio’s picture

    My apologies, this works perfectly. I forgot to update template.php diff as well. Thanks a million