On 12/11/2015 5:22 AM, Neum Schmickrath wrote:
I have a layout I'm working on that has a sidebar that displays a
sub-menu of the child pages of the current page being viewed. On
category pages I can easily test if there are child categories by
using {% if child_categories %} and then showing the sidebar. On pages
is there a similar processor that I'm missing somehow? I don't want to
display an empty sidebar if there won't be any links there.
The navigation menu from the left hand side of Mezzanine default uses this:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/templates/pages/menus/tree.html#L20
page.has_children_in_menu
Would this work?
There's also an attribute "has_children" set on the page in the
page_menu template tag:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/templatetags/pages_tags.py#L84
I'm sure both of these might point you in the right direction.
Seeya. Danny.
--
You received this message because you are subscribed to the Google Groups "Mezzanine
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.