You are here

superfish-menu-items.html.twig in Superfish 8

Default theme implementation of Superfish menu items.

Available variables:

  • html_id: Unique menu item identifier.
  • item_class: Menu item classes.
  • link: Link element.
  • link_menuparent: Link element, when a menu parent.
  • children: Menu item children.
  • multicolumn_wrapper: Whether the menu item contains a column.
  • multicolumn_column: Whether the menu item contains a column.
  • multicolumn_content: Whether the menu item contains a column.

File

templates/superfish-menu-items.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation of Superfish menu items.
  5. *
  6. * Available variables:
  7. * - html_id: Unique menu item identifier.
  8. * - item_class: Menu item classes.
  9. * - link: Link element.
  10. * - link_menuparent: Link element, when a menu parent.
  11. * - children: Menu item children.
  12. * - multicolumn_wrapper: Whether the menu item contains a column.
  13. * - multicolumn_column: Whether the menu item contains a column.
  14. * - multicolumn_content: Whether the menu item contains a column.
  15. *
  16. * @see template_preprocess_superfish_menu_items()
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. {% set classes = [] %}
  22. {% spaceless %}
  23. {% for item in menu_items %}
  24. {% if item.children is not empty %}
  25. {% set item_class = item.item_class ~ ' menuparent' %}
  26. {% if item.multicolumn_column %}
  27. {% set item_class = item_class ~ ' sf-multicolumn-column' %}
  28. {% endif %}
  29. {% endif %}
  30. <li{{ item.attributes }}>
  31. {% if item.multicolumn_column %}
  32. <div class="sf-multicolumn-column">
  33. {% endif %}
  34. {% if item.children is not empty %}
  35. {{ item.link_menuparent }}
  36. {% else %}
  37. {{ item.link }}
  38. {% endif %}
  39. {% if item.multicolumn_wrapper %}<ul class="sf-multicolumn">
  40. <li class="sf-multicolumn-wrapper {{ item.item_class }}">
  41. {% endif %}
  42. {% if item.children is not empty %}
  43. {% if item.multicolumn_content %}<ol>{% else %}<ul>{% endif %}
  44. {{ item.children }}
  45. {% if item.multicolumn_content %}</ol>{% else %}</ul>{% endif %}
  46. {% endif %}
  47. {% if item.multicolumn_wrapper %}</li></ul>{% endif %}
  48. {% if item.multicolumn_column %}</div>{% endif %}
  49. </li>
  50. {% endfor %}
  51. {% endspaceless %}