Extending the Toolbar
We’ll create a toolbar using a sub-class.
Note
supported_apps
is a list of application names in which the toolbar should be active. Usually you don’t need to setsupported_apps
- the appropriate application will be detected automatically. In this case (since the views for the Polls application are in , while ourcms_toolbars.py
is in thepolls_cms_integration
application) we need to specify both explicitly.watch_models
allows the frontend editor to redirect the user to the model instance whenever an instance of this model is created or saved through the frontend editor (see Detecting URL changes for details).
See it at work
Visit your Polls page on your site, and you’ll see a new Polls item in the toolbar.
There’s a lot more to django CMS toolbar classes than this - see How to extend the Toolbar for more.