Reputation: 1105
The template I'm specifically talking about is the one that is used when a user add's a plugin to a page. Both in the admin area, and when modifying pages directly, it is displayed using an iframe.
The template itself is located cms/templates/admin/cms/page/plugin_change_form.html.
My problem is that I need some javascript to populate a drop down list within the form. All the javascript is run before the iframe is added to the page though, so I thought if I managed to edit the template I can tell the iframe to load some specific js. I can obviously just change the template directly, but that's a bit of an undesirable solution. I would rather keep it within the django application and even better have the js run only on specific plugins.
Any thoughts are appreciated.
Upvotes: 0
Views: 1109
Reputation: 4781
You can set the change_form_template
on your CMSPluginBase
subclass, as CMSPluginBase
is a subclass of django.contrib.admin.options.ModelAdmin
.
Upvotes: 2