diff --git a/publichealth/home/templates/home/article_page.html b/publichealth/home/templates/home/article_page.html
index 04ae090..d927e37 100644
--- a/publichealth/home/templates/home/article_page.html
+++ b/publichealth/home/templates/home/article_page.html
@@ -1,6 +1,5 @@
{% extends "base.html" %}
-{% load wagtailcore_tags %}
-{% load wagtailimages_tags %}
+{% load wagtailcore_tags wagtailimages_tags %}
{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %}
diff --git a/publichealth/home/templates/home/home_page.html b/publichealth/home/templates/home/home_page.html
index 6998d05..b0a1e21 100644
--- a/publichealth/home/templates/home/home_page.html
+++ b/publichealth/home/templates/home/home_page.html
@@ -1,6 +1,5 @@
{% extends "base.html" %}
-{% load wagtailcore_tags %}
-{% load wagtailimages_tags %}
+{% load wagtailcore_tags wagtailimages_tags %}
{% block body_class %}template-{{ self.get_verbose_name|slugify }}{% endblock %}
diff --git a/publichealth/home/templates/tags/top_menu.html b/publichealth/home/templates/tags/top_menu.html
new file mode 100644
index 0000000..268a352
--- /dev/null
+++ b/publichealth/home/templates/tags/top_menu.html
@@ -0,0 +1,18 @@
+{% load navigation wagtailcore_tags %}
+{% get_site_root as site_root %}
+
+
+
+ {% for menuitem in menuitems %}
+
+ {% endfor %}
+
+
+
diff --git a/publichealth/home/templates/tags/top_menu_children.html b/publichealth/home/templates/tags/top_menu_children.html
new file mode 100644
index 0000000..5ae4613
--- /dev/null
+++ b/publichealth/home/templates/tags/top_menu_children.html
@@ -0,0 +1,8 @@
+{% load navigation wagtailcore_tags %}
+
+
diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py
index 40ce300..75d1196 100644
--- a/publichealth/home/templatetags/navigation.py
+++ b/publichealth/home/templatetags/navigation.py
@@ -12,3 +12,37 @@ def language_switcher(context):
'currentlangcode': translation.get_language(),
'request': context['request'],
}
+
+@register.assignment_tag(takes_context=True)
+def get_site_root(context):
+ # NB this returns a core.Page, not the implementation-specific model used
+ # so object-comparison to self will return false as objects would differ
+ return context['request'].site.root_page
+
+def has_menu_children(page):
+ return page.get_children().live().in_menu().exists()
+
+# Retrieves the top menu items
+@register.inclusion_tag('tags/top_menu.html', takes_context=True)
+def top_menu(context, parent, calling_page=None):
+ menuitems = parent.get_children().live().in_menu()
+ for menuitem in menuitems:
+ menuitem.show_dropdown = has_menu_children(menuitem)
+ menuitem.active = (calling_page.url.startswith(menuitem.url)
+ if calling_page else False)
+ return {
+ 'calling_page': calling_page,
+ 'menuitems': menuitems,
+ 'request': context['request'],
+ }
+
+# Retrieves the children of the top menu items for the drop downs
+@register.inclusion_tag('tags/top_menu_children.html', takes_context=True)
+def top_menu_children(context, parent):
+ menuitems_children = parent.get_children()
+ menuitems_children = menuitems_children.live().in_menu()
+ return {
+ 'parent': parent,
+ 'menuitems_children': menuitems_children,
+ 'request': context['request'],
+ }
diff --git a/publichealth/templates/footer.html b/publichealth/templates/footer.html
index a0e8716..42e3e8a 100644
--- a/publichealth/templates/footer.html
+++ b/publichealth/templates/footer.html
@@ -12,7 +12,6 @@
Information zu Public Health
Agenda
-