Q: page_is_active

15 views
Skip to first unread message

Robert Slotboom

unread,
Oct 14, 2014, 6:34:22 AM10/14/14
to django-...@googlegroups.com
Hi Folks,

page_is_active:

The advantage of page_is_active compared to the previous tags is that it also nows how to handle page pretenders.
If entry is a page pretender, the template tag returns True if the current path starts with the page pretenders path.



if isinstance(page, PagePretender):
    if path is None:
        path = context['request'].path_info
        return page.get_absolute_url().startswith(path)



I have got the feeling it’s just the other way around.
Am I right or wrong?

Cheers,

Rob





Matthias Kestenholz

unread,
Oct 14, 2014, 7:26:01 AM10/14/14
to FeinCMS
Hi Rob

That's completely correct. It has been fixed here:


Unfortunately this change is not yet available in a released version of FeinCMS.

Thanks,
Matthias


Robert Slotboom

unread,
Oct 15, 2014, 3:26:13 AM10/15/14
to django-...@googlegroups.com
Your welcome,

Rob
Reply all
Reply to author
Forward
0 new messages