On 29/03/2016 11:40, Jonas Obrist wrote:
> The way I solved this in the past was a custom toolbar middleware
> (subclassing the normal one), overwriting is_cms_request [1] to see if
> the toolbar should be shown or not (based on user account info)
Likewise.
I subclassed the templatetag for the same reason, but Jonas' solution is
a lot cleaner
>
> Jonas
>
> [1]
https://github.com/divio/django-cms/blob/6868946e8867112c5c8db6a80ee6a442eb36fbb1/cms/middleware/toolbar.py#L55
>
> On Tuesday, March 29, 2016 at 6:13:09 PM UTC+9, Daniele Procida wrote:
>
> On Wed, Mar 23, 2016, Christopher Marshall <
cbmam...@gmail.com
> <mailto:
cbmam...@gmail.com>> wrote:
>
> >If I include {% cms_toolbar %} in the template I get the tool bar
> all the
> >time and if I take it out the tool bar is shown none of the time.
> So how
> >do I make the display conditional on having a logged in user
> wanting to
> >edit the page?
>
> One would expect this to work:
>
> {% if request.user.is_authenticated %}
> {% cms_toolbar %}
> {% endif %}
>
> though it doesn't. I am not sure why.
>
> Any better suggestions?
>
> Daniele
>
> --
> Message URL:
>
https://groups.google.com/d/msg/django-cms-developers/topic-id/message-id
> Unsubscribe: send a message to
>
django-cms-devel...@googlegroups.com
> ---
> You received this message because you are subscribed to the Google
> Groups "django CMS developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
django-cms-devel...@googlegroups.com
> <mailto:
django-cms-devel...@googlegroups.com>.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/django-cms-developers/9dc2fb1f-6aba-4d63-8775-870bc4e99991%40googlegroups.com
> <
https://groups.google.com/d/msgid/django-cms-developers/9dc2fb1f-6aba-4d63-8775-870bc4e99991%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit
https://groups.google.com/d/optout.
--
Iacopo Spalletti
Nephila s.a.s. - Firenze
Telefono:
+39 055 5357189
Assistenza Tecnica:
+39 055 3985730
http://nephila.it