yannickoo / menu_link_attributes

:droplet: Contains the Menu Link Attributes module for Drupal.

Home Page:https://www.drupal.org/project/menu_link_attributes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add class to list item instead / in addition to link

vegardjo opened this issue · comments

Hi, I would very much like an option to add the class to the menu list item (<li>), not the menu link (<a>) itself.

In my case I have a nested menu where I would like to style the child li items based on the class of the parent, but this is not possible when the class is added to the link as the structure is:

  • li
    • a
    • ul
      • li
      • a

In general adding it to the highest level makes styling a lot easier.

I realise this cannot be done for options like for instance target, and also that you can't break the current functionality, but maybe something like a checkbox "add to list item" for the class option could be feasible?

I second that request

Hey! You can try the latest version and create a new attribute starting with container_ e.g. container_class. It will appear in Container attributes automatically 😇

Screenshot

screen shot 2017-10-04 at 00 21 26