Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django CMS 3 Detect if I am facing 'structure' or 'content'

Tags:

django-cms

Django CMS 3 has two modes: structure and content.

I need to detect if the user is using one or the other in order to apply specific css.

Is there a way to to this?

like image 410
jobima Avatar asked Jan 28 '15 11:01

jobima


1 Answers

You can detect the current mode via request.toolbar.build_mode and request.toolbar.edit_mode like this:

{% if request.toolbar.build_mode %}
    We're in structure mode!
{% elif request.toolbar.edit_mode %}
    We're in content mode !
{% else %}
    We're not in edit mode!
{% endif %}
like image 115
ojii Avatar answered Jan 01 '23 12:01

ojii