Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the D7 version of this module there was an option to activate first/last classes on li. I found this useful, are there any plans to port that feature to the D8 version?
Comment | File | Size | Author |
---|---|---|---|
#3 | [add-first-last-classes-on-li-in-menu]-[2920948]-[3].patch | 2.96 KB | v.belous |
Comments
Comment #2
v.belous CreditAttribution: v.belous commentedComment #3
v.belous CreditAttribution: v.belous commentedThis patch includes a settings form for Superfish module. This form include option - add first/last classes for li elements. Form settings are useful for modifying the module in the future.
Comment #4
v.belous CreditAttribution: v.belous commentedExists another way for this issue - change only superfish-menu-items.html.twig file
We can use "special variables" loop.first and loop.last
Example:
{% for elem in arrMenu %}
{% if loop.first %}
// some html element with "first" class
{% elseif loop.last %}
// some html element with "last" class
{% else %}
// some html element without classes
{% endif %}
// some html structure
{% endfor %}
If you need this I can add this way in the new patch
Comment #5
v.belous CreditAttribution: v.belous commented