Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon

Showing 1-11 of 11 messages
Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Divio Developers 2/3/11 6:29 AM
https://github.com/divio/django-cms/issues/labels/feature%20request#issue/300
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon benzkji 2/4/11 5:11 AM
BIG +1
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Jonas Obrist 2/4/11 5:52 AM
While I'm +1 on this, i don't see how to properly implement this...
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Martin 2/4/11 5:59 AM
super big +1 :)
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon benzkji 2/4/11 6:09 AM
already thought this could be the reason why it is as it is right now ;)
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Benjamin Wohlwend 2/4/11 8:21 AM
On Fri, Feb 4, 2011 at 2:52 PM, Jonas Obrist <ojii...@gmail.com> wrote:
> While I'm +1 on this, i don't see how to properly implement this...

I don't know about "properly", but at least for TinyMCE it is doable.
I'll try to adapt this functionality from an old project of mine...

Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Jonas Obrist 2/4/11 8:25 AM
Basically if we solve this, we should solve this generally, not just for the Link plugin.

Plugins should be more flexible in deciding how it want's itself being displayed within Text plugins (or any other plugins allowing embed plugins).

Jonas
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Jonas Obrist 2/25/11 2:15 AM
Okay I've given this some more thought, and while I have no clue if this is doable in the frontend side this is what I propose:

Instead of inserting an image with the plugin id hacked on it, we insert a 'cmsplugin' HTML tag with a 'pluginid' attribute, containing it's database ID. Inside this tag, the plugin can decide for itself how it would like to be rendered. This would look like this: https://gist.github.com/843607#file_new_cmsplugin_admin_editor.html

On save we would strip the contents inside the 'cmsplugin' tags, and instead only store the ID there: https://gist.github.com/843607#file_new_cmsplugin_database_representation.html

In the frontend it renders without the 'cmsplugin' tags at all: https://gist.github.com/843607#file_new_cmsplugin_frontend_representation.html

Now let's talk python:

When rendering the admin textarea, the 'cmsplugin' tags are scanned for their IDs. To fill those tags with the content the nested plugin wants to show in the admin, a method "CMSPluginBase.get_embed_content(self, instance, parent_instance)" gets called. parent_instance is given, so in case there's more than one plugin type that uses the tree functionality of plugins, the plugin can decide how it wants to get rendered for each plugin type.


On saving, we strip anything inside the 'cmsplugin' tags.

When displaying in frontend, we strip all the 'cmsplugin' tags completely.

For the transition period, CMSPluginBase.get_embed_content should fall back to render the image using CMSPluginBase.icon_src and CMSPluginBase.icon_alt.

Thoughts?

Jonas
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Daniele Procida 2/25/11 2:54 AM
On Fri, Feb 25, 2011, Jonas Obrist <ojii...@gmail.com> wrote:

>Okay I've given this some more thought, and while I have no clue if this is
>doable in the frontend side this is what I propose:
>
>Instead of inserting an image with the plugin id hacked on it, we insert a
>'cmsplugin' HTML tag with a 'pluginid' attribute, containing it's database
>ID. Inside this tag, the plugin can decide for itself how it would like to
>be rendered.

Two questions about implications:

Good: couldn't this be used for other plugins too, to show information
about them that currently we can't show in the plugin icon?

Bad: would it make dragging plugins around in the editor harder?

Daniele

Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Jonas Obrist 2/25/11 3:03 AM
1: The point is exactly to allow plugins to show information other than an image.
2: No idea. Some JS guy has to answer that question.
Re: Proposal [from github]: Feature Req: Link Plugins in rich text editors should display as link text, not as an icon Jacob Rief 9/3/13 2:39 PM
Today I found a possible solution to fix it for djangocms-text-ckeditor as used for django-cms 3.0.0 beta2.
Check my PR #71
- Jacob