Skip to content

Allow including the plugin inside text editing plugins #5

@lddubeau

Description

@lddubeau

The stock plugin cannot currently be included inside contents edited with text plugin.

For my own purposes, I've been able to add this functionality to my project by overriding the stock plugin with this code:

import os

from cms.plugin_pool import plugin_pool
from cmsplugin_iframe.cms_plugins import IframePlugin
from django.conf import settings
from django.utils.translation import ugettext as _
from filer.settings import FILER_STATICMEDIA_PREFIX


class MyIframePlugin(IframePlugin):
    text_enabled = True

    def icon_src(self, instance):
        return os.path.normpath("%s/icons/video_%sx%s.png" %
                                (FILER_STATICMEDIA_PREFIX, 32, 32,))

plugin_pool.unregister_plugin(IframePlugin)
plugin_pool.register_plugin(MyIframePlugin)

I use an icon from the filer package because that was expedient. I'm not suggesting this should be part of the final solution.

I did not do this in the code above but icon_alt should also be implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions