Search code examples
djangodjango-cms

DjangoCMS 3 Filter Available Plugins


In the DjangoCMS3 documentation it says you can configure DjangoCMS behavior using CMS_PLACEHOLDER_CONF in your settings. For instance:

CMS_PLACEHOLDER_CONF = { 'right-column': { 'plugins': ['TextPlugin', 'PicturePlugin'], ...

This would make TextPlugin and PicturePlugin to be the only two plugins available inside any placeholder called "right-column".

It works, but what if I want this restriction to apply to ALL placeholders??

Thanks!


Solution

  • Remove plugins you don't need from INSTALLED_APPS.

    Alternatively, in an app after all plugin apps in INSTALLED_APPS in either cms_plugins.py or models.py you can use cms.plugin_pool.plugin_pool.unregister_plugin to remove them from the pool:

    from cms.plugin_pool import plugin_pool
    from unwanted_plugin_app.cms_plugins import UnwantedPlugin
    
    plugin_pool.unregister_plugin(UnwantedPlugin)