Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
Unfortunately the using "CSS class" under "Advanced" doesn't work, because Views wraps another class between the class added by me and he actual nodes.
my website menu has multiple levels. On the mobile version, I am working with Accordion elements to expand/collapse them. I want to realize my menu without JS and with CSS only. Therefore, I use checkboxes to trigger the accordion elements to expand/collapse.
For the mobile menu, I created a custom twig template. I added the complete Code below.
Since the checkboxes in my menu are invisible, I work with label elements. Therefore, my checkboxes and the labels have IDs to assign them correctly.