misc: pass ignore visibility flag to submenus (#29175)

This commit is contained in:
Frédéric Péters 2018-12-18 12:32:42 +01:00
parent 7fab95e8cf
commit 0e4b20ab8f
2 changed files with 2 additions and 1 deletions

View File

@ -33,6 +33,7 @@ def get_menu_context(context, level=0, current_page=None, depth=1, ignore_visibi
if 'hierarchical_pages_by_id' not in context:
context['hierarchical_pages_by_id'] = Page.get_with_hierarchy_attributes()
pages_by_id = context['hierarchical_pages_by_id']
context['ignore_visibility'] = ignore_visibility
context['depth'] = depth
if current_page is None:
current_page = pages_by_id.get(context['page'].id, context['page'])

View File

@ -6,7 +6,7 @@
<li data-menu-page-id="{{ menuitem.page.id }}" class="menu-{{ menuitem.page.slug }} {% if menuitem.selected %}selected{% endif %}"><a
href="{% page_absolute_url menuitem.page %}"><span>{{ menuitem.page.title }}</span></a>
{% if depth > 1 %}
{% show_menu current_page=menuitem.page level=-1 depth=depth reduce_depth=True %}
{% show_menu current_page=menuitem.page level=-1 depth=depth reduce_depth=True ignore_visibility=ignore_visibility %}
{% endif %}
</li>
{% endfor %}