Answer the question
In order to leave comments, you need to log in
How to add custom data to template context in django-cms for regular page?
There is a regular django-cms.
There is an application that adds instances of objects in the admin panel (although this is not so important).
I need to pass a complete list of these objects to a regular page so that the template can process and render them. How to do it?
The plugin option does not work, because one instance is inserted, and I need all of them. And I don’t need to insert it into the placeholder, it’s more convenient right in the template.
Answer the question
In order to leave comments, you need to log in
It's decided. It was necessary to sleep through the night, re-read and comprehend the documentation, in which everything is there.
It is based on a plugin .
def render(self, context, instance, placeholder):
context.update({'instance': instance})
return context
context.update({'instance': instance})
where you can put whatever you want.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question