8000 Minor text revisions · django-cms/django-cms@d328ba3 · GitHub
[go: up one dir, main page]

Skip to content

Commit d328ba3

Browse files
committed
Minor text revisions
1 parent e41e314 commit d328ba3

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docs/how_to/toolbar.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,21 +409,25 @@ The attribute ``app_path`` will contain the name of the application handling the
409409
Modifying an existing toolbar
410410
*****************************
411411

412-
If you need to modify an existing toolbar (say to change the ``supported_apps`` attribute) you can
413-
do this by extending the original one, and modifying the appropriate attribute.
412+
If you need to modify an existing toolbar (say to change an attribute or the behaviour of a method)
413+
you can do this by creating a sub-class of it that implements the required changes, and registering
414+
that instead of the original.
414415

415-
If :setting:`CMS_TOOLBARS` is used to register the toolbars, add your own toolbar instead of the
416-
original one, otherwise unregister the original and register your own::
416+
The original can be unregistered using ``toolbar_pool.unregister()``, as in the example below.
417+
Alternatively if you orginally invoked the toolbar class using :setting:`CMS_TOOLBARS`, you will
418+
need to modify that to refer to the new one instead.
419+
420+
An example, in which we unregister the original and register our own::
417421

418422

419423
from cms.toolbar_pool import toolbar_pool
420424
from third_party_app.cms_toolbar import ThirdPartyToolbar
421425

422426
@toolbar_pool.register
423427
class MyBarToolbar(ThirdPartyToolbar):
424-
supported_apps = ('third_party_app', 'my_app')
428+
[...]
425429

426-
toolbar_pool.unregister(FooToolbar)
430+
toolbar_pool.unregister(ThirdPartyToolbar)
427431

428432

429433
.. _url_changes:

0 commit comments

Comments
 (0)
0