diff --git a/publichealth/home/templatetags/navigation.py b/publichealth/home/templatetags/navigation.py index f571dcf..be7a954 100644 --- a/publichealth/home/templatetags/navigation.py +++ b/publichealth/home/templatetags/navigation.py @@ -37,24 +37,26 @@ def top_menu(context, parent, calling_page=None): '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): +def menuitems_children(parent): menuitems_children = parent.get_children().live().in_menu().specific() for menuitem in menuitems_children: menuitem.title = menuitem.trans_title + return menuitems_children + +# 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): return { 'parent': parent, - 'menuitems_children': menuitems_children, + 'menuitems_children': menuitems_children(parent), 'request': context['request'], } # Retrieves the footer menu items @register.inclusion_tag('tags/footer_menu.html', takes_context=True) def footer_menu(context, parent, calling_page=None): - menuitems = parent.get_children().live().in_menu() return { 'calling_page': calling_page, - 'menuitems': menuitems, + 'menuitems': menuitems_children(parent), 'request': context['request'], } \ No newline at end of file