You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, for some reason step 2 has been removed, and step 3 modified to cope, I think mistakenly: 8ef9832#L12L50
So now the database is storing obscure <img> tags to represent plugins, making it harder to understand and more fragile (e.g. if some other editor is used to edit the HTML, which doesn't preserve the 'id' attribute on the <img> tags, or if you want to export your data).
Fixing this would be tricky - we would need a datamigration to fix all up the this stuff, which could take a while to run.
We would also need to change the way that the admin saves the HTML, so that plugin_admin_html_to_tags is actually used. I haven't looked into doing this yet, but should just be a matter of appropriate code in the ModelAdmin.save_model()
The alternative is to just live with it, and fix the code accordingly. Currently there is a whole bunch of confusing cruft in cms/plugins/text/utils.py and some in cms/plugins/text/models.py
(I'm happy to do either of these., BTW).
The text was updated successfully, but these errors were encountered:
I agree that the text plugin does weird magic. And I agree we need to fix this.
It seems that this could be somewhat related to the ever-recurring discussion about displaying plugins with something else than images in the admin. An idea I had once (and have no idea whether it's feasible or not) is to have a <cmsplugin id=141 /> tag instead of obscure image tags to identify cmsplugin positions. Then either have custom content (images or whatever) embedded inside that tag or somehow do that via javascript.
The big advantage that images in the admin provide is draggability. In every other respect, they are poor - they are hacky and weird and make the source in the editor unpleasant to look at.
Also, some users seem to manage to turn them into content in the editor somehow.
But, I don't know what would be a good alternative.
As for storage in the database, storing them as renderable templatetags would be more elegant and presumably slightly faster too.
The way that the admin for text plugins used to work (probably back in django-cms 1.0 days, I can't trace it all the way), was like this:
<img>
tags to represent embedded plugins.I know this, because I designed it, and it is described here: https://groups.google.com/forum/#!msg/django-cms/Q4L5m408U6I/-BtSqAReSTIJ
Unfortunately, for some reason step 2 has been removed, and step 3 modified to cope, I think mistakenly: 8ef9832#L12L50
So now the database is storing obscure
<img>
tags to represent plugins, making it harder to understand and more fragile (e.g. if some other editor is used to edit the HTML, which doesn't preserve the 'id' attribute on the<img>
tags, or if you want to export your data).Fixing this would be tricky - we would need a datamigration to fix all up the this stuff, which could take a while to run.
We would also need to change the way that the admin saves the HTML, so that plugin_admin_html_to_tags is actually used. I haven't looked into doing this yet, but should just be a matter of appropriate code in the ModelAdmin.save_model()
The alternative is to just live with it, and fix the code accordingly. Currently there is a whole bunch of confusing cruft in cms/plugins/text/utils.py and some in cms/plugins/text/models.py
(I'm happy to do either of these., BTW).
The text was updated successfully, but these errors were encountered: