Did anything like this ever get implemented into mezzanine? I was looking
to do something similar, add a sidebar in the base.html if the given page
has children. What was your fix?
On Wednesday, November 11, 2015 at 5:56:20 PM UTC-6, Neum Schmickrath wrote:
>
> Thanks for the reply Danny. The problem with both of those is they expect
> to be in a recursive "for" loop so I'll get back multiple results depending
> on how many children there are. I'll go ahead and create my own for now.
> Just didn't want to be adding something that was already there :)
>
> On Wednesday, November 11, 2015 at 2:04:20 PM UTC-7, Danny S wrote:
>>
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.