4. API References

4.1. cms.plugin_base

class cms.plugin_base.CMSPluginBase

Inherits django.contrib.admin.options.ModelAdmin.


Defaults to True, if False no preview is done in the admin.


Custom template to use to render the form to edit this plugin.


Custom form class to be used to edit this plugin.


Is the CMSPlugin model we created earlier. If you don’t need a model because you just want to display some template logic, use CMSPlugin from cms.models as the model instead.


Will be group the plugin in the plugin editor. If module is None, plugin is grouped “Generic” group.


Will be displayed in the plugin editor.


If set to False, this plugin will not be rendered at all.


Will be rendered with the context returned by the render function.


Whether this plugin can be used in text plugins or not.


Returns the alt text for the icon used in text plugins, see icon_src().


Returns the url to the icon to be used for the given instance when that instance is used inside a text plugin.

render(context, instance, placeholder)

This method returns the context to be used to render the template specified in render_template.

  • context – Current template context.
  • instance – Plugin instance that is being rendered.
  • placeholder – Name of the placeholder the plugin is in.
Return type:


class PluginMedia

Defines media which is required to render this plugin.


The CSS files required to render this plugin as a dictionary with the display type as keys and a sequence of strings as values.


The Javascript files required to render this plugin as a sequence of strings.

4.2. menus.base

A navigation node in a menu tree.

  • title (string) – The title to display this menu item with.
  • url (string) – The URL associated with this menu item.
  • id – Unique (for the current tree) ID of this item.
  • parent_id – Optional, ID of the parent item.
  • parent_namespace – Optional, namespace of the parent.
  • attr (dict) – Optional, dictionary of additional information to store on this node.
  • visible (bool) – Optional, defaults to True, whether this item is visible or not.

Project Versions

Table Of Contents

Previous topic

3. App Integration

Next topic

5. Placeholders outside the CMS

This Page