Menu
The Menu component adds drop down navigation.
{% embed '@forumify/components/menu.html.twig' with {
placement: '...',
hideAdornment: true/false,
buttonClass: '...'
} &}
{% block button_text %}...{% endblock %}
{% block menu_items %}
...
{% endblock %}
{% endembed %}
This component utilises the twig embed tag which allows you to include another template's contents. Learn more about twig embed here
Structure
The intended structure for the menu component can be seen in the below example:
{% embed '@Forumify/components/menu.html.twig' with {
placement: 'bottom-end',
hideAdornment: false,
buttonClass: 'btn-primary'
} %}
{% block button_text %}Menu Name{% endblock %}
{% block menu_items %}
<a class="btn-link" href="link">Button Name</a>
<a class="btn-link" href="link">Button Name</a>
{% endblock %}
{% endembed %}
Customisation
Menu has a few options of customisation.
Placement
Gives you the option of the menu opening position.
Primary Placements:
topbottomleftright
Alignment Placements:
top-start/top-endbottom-start/bottom-endleft-start/left-endright-start/right-end
Auto Placement:
auto(automatically chooses the best position based on available space)
hideAdornment
hideAdornment is a togglable option to hide and show the caret . By default, it is set to false, to hide it simply change hideAdornment: to false.
buttonClass
buttonClass lets you add classes to the button. forumify's framework comes with a variety of button options which you can see here