Remove empty items from menu

This commit is contained in:
M.Ravi 2017-10-19 16:04:18 +02:00
parent 55dd96570c
commit c448562384
2 changed files with 4 additions and 2 deletions

View file

@ -37,6 +37,8 @@ class TestMenu(CMSAttachMenu):
section_hash = request.build_absolute_uri()
if hasattr(plugin, 'menu_text'):
menu_text = plugin.menu_text
if menu_text.strip() == '':
continue
menu_words = menu_text.split()
if len(menu_words) > 0:
section_hash = '{}#{}'.format(
@ -56,4 +58,4 @@ class TestMenu(CMSAttachMenu):
return nodes
menu_pool.register_menu(TestMenu)
menu_pool.register_menu(TestMenu)

View file

@ -61,7 +61,7 @@
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<!-- Start Navbar collapse-->
<ul class="nav navbar-nav navbar-right">
{% show_menu 1 1 0 1 "ungleich_page/glasfaser/menus.html" %}
{% show_sub_menu 1 None 100 "ungleich_page/glasfaser/menus.html" %}
</ul>
<!-- /.navbar-collapse -->
</div>