7
7
7761662017-02-05 03:29:24
Django
776166, 2017-02-05 03:29:24

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

1 answer(s)
7
776166, 2017-02-05
@776166

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

This is context.update({'instance': instance})where you can put whatever you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question