From c4485623841e0995b3a5cfdec29d4b661370a10e Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 16:04:18 +0200 Subject: [PATCH] Remove empty items from menu --- ungleich_page/cms_menus.py | 4 +++- ungleich_page/templates/ungleich_page/glasfaser_cms_page.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ungleich_page/cms_menus.py b/ungleich_page/cms_menus.py index ebba3515..f3a2a694 100644 --- a/ungleich_page/cms_menus.py +++ b/ungleich_page/cms_menus.py @@ -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) \ No newline at end of file +menu_pool.register_menu(TestMenu) diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index 8f76b29f..0aebb93c 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -61,7 +61,7 @@