Question

My problem

With Django CMS 2.3.3, when creating a Page I use cmsplugin_picture* next to a couple of other cmsplugins. In my cms template, instead of doing:

{% placholder "content" %}  //calling the Django Page including all plugins...

I would like to call each cmsplugin seperately, but how would I do that? I looked at Django tag template (filters) here and also studied Django CMS template tags here, but neither seem to suggest that possibility. I have to say I am a beginner so I might not have connected the dots...

What I try to achieve:

In my template I have a IMG tag (outside of the {% placeholder "content" %} tag) which I want to populate with an image url that I define in my Page/cmsplugin_picture. So I am looking for a placeholder tag that allows me to grab that image. In my wildest dreams I would name it:

{% show_placeholder "content" request.current_page.get_cmsplugin_picture %}

Obviously the above doesn't work, but does something like this exist?

**I have also tried cmsplugin_filer, but to me it isn't necessarely more beneficial to fix this particular problem.*

EDIT: What I mean by Page/cmsplugin_picture -> In a Django CMS Page you can select between your installed cmsplugins to add to a Page. In my case I select cmsplugin_picture and upload an image (within that plugin). This image I want to 'call' in my Django Template. So it is a not a static url, but dynamic.

Was it helpful?

Solution

You should make a second placeholder where your img tag is (and optionally limit the types and amount of plugins using CMS_PLACEHOLDER_CONF (http://docs.django-cms.org/en/2.3.3/getting_started/configuration.html#cms-placeholder-conf).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top