Base class for Plugins. These classes are used to display contents on a djpcms powered site. The basics:
If set to true, the class won’t be registered with the plugin’s dictionary. Default False.
Unique name. If not provided the class name will be used. Default None.
A short description to display in forms.
Form class for editing the plugin parameters. Default None, the plugin has no arguments.
Equivalent to djpcms.views.appsite.ModelApplication.form_withrequest. If set to True, the request instance is passed to the form constructor. Default is False.
Function which can be used to inject javascript dynamically.
Function which can be used to inject css dynamically.
You can use this hook to perform pre-processing on plugin parameters if form is set. By default do nothing.
Returns the form used to edit the plugin content. Most plugins don’t need to implement this functions but some do. Check the djpcms.plugins.text.Text for example. By default it returns None.
Render the plugin. It returns a safe string to be included in the HTML page. This is the function plugins need to implement.
Save the form plugin
Return an instance of a form or None. Used to edit the plugin when in editing mode. Usually, there is no need to override this function. If your plugin needs input parameters when editing, simple set the form attribute.