Closed sabueso closed 4 years ago
Hi @sabueso. Thank you for taking the time to highlight this problem. I will look at improving things soon.
Thanks to you @ababic, wagtailmenus is a great piece of software for Wagtail: create menus in the CMS should be more muche easier as in wagtailmenus.
IMHO, the documentation side is incredible important: not always the technical skills in Django are the most and a cleaner documentation is a key to arrive to a lot of (new) users.
Thanks again!
Hi!
I was following this section as a guide, trying to create a simple menu with a separate custom template file.
As a kickstart, I've created in my html home file:
{% load menu_tags %} {% main_menu max_levels=3 template="custom_main_menu.html"%}
In a separate template file, I've created this other part of code copy/pasting the example saw in the documentation:
<!-- start menu area --> <ul class="navbar-nav ml-auto" id="nav" style="display: none;"> {% for item in menu_items %} <li class="{{ item.active_class }}"><a href="{{ item.href }}"> {{ item.text }}</a> {% if item.has_children_in_menu %} {% sub_menu item %} {% endif %} </li> {% endfor %} </ul> <!-- end menu area -->
Once did this, I was trying to debug the following error on Django side:
TemplateSyntaxError **Invalid block tag on line 6: 'sub_menu', expected 'elif', 'else' or 'endif'. Did you forget to register or load this tag?** /usr/local/lib/python3.7/dist-packages/django/template/base.py in invalid_block_tag, line 527 /usr/bin/python 3.7.3
Googling some hours, I've found this example and I advised I was not using "{% load menu_tags %}" on the top of the separate template file (I was totally sure was not needed because I've called the load primitive in the main html, and the doc said nothing about)
Maybe could be an improvement for newbies (and late-night-coders) as me to wagtailmenus, to add the "load menu_tags" to the first mentioned example snippet too, in order to avoid misunderstoods.
Thanks!
Hi!
I was following this section as a guide, trying to create a simple menu with a separate custom template file.
As a kickstart, I've created in my html home file:
In a separate template file, I've created this other part of code copy/pasting the example saw in the documentation:
Once did this, I was trying to debug the following error on Django side:
Googling some hours, I've found this example and I advised I was not using "{% load menu_tags %}" on the top of the separate template file (I was totally sure was not needed because I've called the load primitive in the main html, and the doc said nothing about)
Maybe could be an improvement for newbies (and late-night-coders) as me to wagtailmenus, to add the "load menu_tags" to the first mentioned example snippet too, in order to avoid misunderstoods.
Thanks!