How to share a plugin (the content in a sidebar widget) in several templates in Django-CMS?

StackOverflow https://stackoverflow.com/questions/19732835

Question

I want to add a common sidebar for all my templates on my site. Let's say, I want a picture and some text, that the final user could modify whenever she feels like without having to mess with my base.html template (the base class of all my templates).

To be clear, I know that I can put plugin place holders with the template tag:

{% placeholder sidebar %}

My problem is that if I have five 5 templates and the content of the sidebar is the same for all of them, the user have to go through all the pages and change them one by one.

On the other hand, it cannot be static because I want the user to be able to modify the content through the admin.

Specifically, I am trying to do this with the cmsplugin-contact which saves me the troubles of configuring forms and emails.

Était-ce utile?

La solution

You can create a special page that isn't published and add a "sidebar" placeholder to the template. You then use the {% show_placeholder %} template tag to render that sidebar placeholder in the base template that each of your 5 other pages are using

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top