Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corentinbettiol/f63d4d278e0efa1b511e4886499a7009 to your computer and use it in GitHub Desktop.
Save corentinbettiol/f63d4d278e0efa1b511e4886499a7009 to your computer and use it in GitHub Desktop.

Here's how to list all plugins in the post_content placeholder of a djangocms-blog post:

for plugin in post_content.get_plugins():
    print(f"{plugin.plugin_type} - [{plugin.position}][{plugin.depth}][{plugin.path}]")
    try:
        print(plugin.get_plugin_instance()[0].body[:50])
    except:
        pass
    print("\n----\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment