开发者

Modifying the django-cms 'add plugin' template on a per plugin basis?

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 bett开发者_如何学编程er have the js run only on specific plugins.

Any thoughts are appreciated.


You can set the change_form_template on your CMSPluginBase subclass, as CMSPluginBase is a subclass of django.contrib.admin.options.ModelAdmin.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜