Closed dsh2dsh closed 13 years ago
When is this going to be merged? It's quite common that the contact form has to be customized.
I always wanted to do this, thank you very much!
Sweet, thanks.
Excuse me, I'm not understanding how to subclass this.
Do I need to remove this the original from the apps? Does creating cms_plugins.py and adding the dir to installed apps suffice? Will both types of plugin appear on the list?
because I'm having trouble with this, maybe I'm missing something silly. Thanks
You can remove the original from the apps. It doesn't matter. If you'll remove it, you will not use the original and will use only your extended plugin. But if you need it you can use both. Just give your plugin different name like here:
class BaseContactPlugin(ContactPlugin):
name = _("Custom Contact Form")
Don't forget, you need your custom cms_plugins.py, a model, a form and I think a template. You can use cms_plugins.py from examples dir as a start point.
oooh.. ok
I'm gonna try a hackier way to go about this, if it works, I'll post about it
The example is a bit rough. I'm putting together a working example right now.
Alright I just pushed the working example.
Please note, that it requires the original cmsplugin_contact in the INSTALLED_APPS because it uses the original admin templates.
Ok. But i also spotted some mistakes in the templates (form.captcha_fiel instead of 'field', is what comes off the top of my head) so I might fork and send some fixes tomorrow.
Great!
See
examples/cmsplugin_custom_contact
how to subclasscmsplugin_custom
and add custom fields into it. You can override properties of subclassedContactPlugin
and use your own templates and classes.