|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|
|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|
|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 :)
|benzkji||2/4/11 6:09 AM|
already thought this could be the reason why it is as it is right now ;)
|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.
|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 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.
|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
Two questions about implications:
Good: couldn't this be used for other plugins too, to show information
Bad: would it make dragging plugins around in the editor harder?
|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.
|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