Make images and other in-text plugins editable directly with tinymce or wymeditor by
forwarding the attributes of the placeholders (particularly class and style) to the rendering context. (Useful for example in picture.html)
save admin tags of in-text plugins in the context
(enables plugins to use class and style attributes set by tinymce)
MODIFIED picture template to use admin-tag's class and style
renamed admin_tag to placeholder
not entirely sure what this does, could you elaborate a bit more what this is all about?
If you insert text-enabled plugins (especially images) tinymce an wymeditor allow to format them by changing their size or setting for example style="float:right;" or class="...". This formatting however is applied to a placeholder image tag, which is replaced on rendering by the actual output of the embedded plugin. Thus the formatting is lost and the user is wondering why his embedded image plugin is aligned right in the editor but not on the page. To solve this I propose to forward the whole placeholder tag (and for convenience its attributes in a dictionary) to the embedded plugin, which is then able to copy for example style and class (like for example in the patched cms/plugins/picture/templates/cms/plugins/picture.html)
sorry, what would be the right place to document this?
custom_plugins.rst would be the right place... i see that there is a need for writing a section for text embed-able plugins as well. Could you do that?
Ok, I'll take a look
still needs docs and remerge
Have a look at pbs@c304042
It implements the same feature (bug fix) by using a proper html parser (avoids error prone regex magic)
I don't think this actually needs any explicit documentation. The fact that styles set by tinymce aren't passed down to child plugins is very annoying. I would consider this a bug fix rather than a feature.
If this pull request got abandoned, I would happily open another (with the changeset linked in the comment above).
@kux yes please open an other PR
Noticed you removed the text plugin from the cms in 28f191c
Is the new djangocms-text-ckeditor compatible with TinyMCE or WYMEditor? (I noticed the widget classes from wymeditor_widget.py and tinymce_widget.py have been removed)
@digi604 I'm sorry for not having found the time to improve the documentation but, you know, my patch is a one liner and to document text-enabled plugins would take some more lines... But I also find it annoying that this problem/bug is still present in the current release.
@kux I wouldn't say my regex solution is error prone: it always finds all attributes of a valid html tag or else it's not a tag! (and even then it doesn't throw an exception but simply finds nothing). On the other hand: don't you think a HTML-Parser is too much overhead for a simple attribute extraction? In both: performance and lines of code
@kux I also had to brood over the context name to use in plugin templates and there may be better names than my placeholder_attributes but IMHO inherited_from_parent is less clear
@kux djangocms-text-ckeditor should be an inplace replacement for cms.plugins.text. It supports inline plugins as well... and supports drag and drop pictures into the editor.... we extract those images and convert them to picture plugins...
@kux how does the PBS version differ from this one?
closing as this would need to be implemented on djangocms-text-ckeditor.