Hi everyone!
I’m looking for a way to turn the “simple menu” module into a dropdown list instead of an actual page menu structure, but I’ve run into a roadblock. I’m probably doing something wrong (trial and error over here!) so any guidance would be much appreciated!
Here’s the code I’ve used to create my own module:
<div class="version-changer"><p>Current as of <select id="version-dropdown">{% for node in module.menu_tree %}<option value="{{ node.menu-item.link }}">{% simple_menu menu_tree="{{ module.menu_tree }}" %}</option>{% endfor %}</select></p></div>
And I’m just using the Simple Menu (label: menu_tree) to do this.
However, when I test this out and add a few menu items for the dropdown to display, I run into issues.
If my options are:
- Blog (/blog)
- News (/news)
- Events (/events)
Then the dropdown menu produces this:
- Blog News Events
- Blog News Events
- Blog News Events
I’ve tried using ChatGPT to help me understand what I’m doing wrong, but when I use the suggestions that it gives me, all the text disappears from the dropdown and I just see 3 (or however many) blank options.
Any help would be amazingly appreciated! ![]()
