I have an issue and cannot load a form from a custom template.
I use a subclass for ContactForm to overwrite the template class variable to something like "bootstrap/contactform.html" and register the alternative form in the project's settings file as described in the docs. However, no matter what I do, only the standard template "cmsplugin_contact/contact.html" is loaded.
If I look into cms_plugins.py it seems to me that the render method of the ContactPlugin class does not change its own render_template variable but only the plugin instance's variable. (Actually I am not sure why this is not the same.) With a quick and dirty check I get the desired result if I add the line self.render_template = instance.render_template after line 167 if file cms_plugins.py. Can you check this?
I have an issue and cannot load a form from a custom template.
I use a subclass for ContactForm to overwrite the template class variable to something like "
bootstrap/contactform.html
" and register the alternative form in the project's settings file as described in the docs. However, no matter what I do, only the standard template "cmsplugin_contact/contact.html
" is loaded.If I look into
cms_plugins.py
it seems to me that therender
method of theContactPlugin
class does not change its ownrender_template
variable but only the plugin instance's variable. (Actually I am not sure why this is not the same.) With a quick and dirty check I get the desired result if I add the lineself.render_template = instance.render_template
after line 167 if filecms_plugins.py
. Can you check this?Thanks very much! Fabian