localgovdrupal / localgov_microsites

A repository for the LocalGov Drupal Microsites project.
GNU General Public License v2.0
3 stars 2 forks source link

Bug: chained classes in menu blocks #173

Closed msayoung closed 2 years ago

msayoung commented 2 years ago

in the main and utility menus we're getting chained classes

block-group-content-menulgms-main-menu block-group-content-menulgms-utility-menu

markconroy commented 2 years ago

Looks like this is not a bug. In block.html.twig (from localgov_base) we are rendering the following classes:

{%
  set classes = [
    'block',
    'block-' ~ configuration.provider|clean_class,
    'block-' ~ plugin_id|clean_class,
  ]
%}

If you check what plugin_id evaluates to, it will be something like group_content_menu:lgms_main_menu. When you apply |clean_class to that, you get group-content-menulgms-main-menu which is what we are getting which looks like a chained class, but actually isn't.

msayoung commented 2 years ago

That would be why I couldnt hunt it down! Thanks @markconroy

I'll close this