I'm trying to add a caption to images inserted into the TinyMCE editor (using the alt-text as the text). Doing it in front end output is fairly easy using javascript, but getting it displayed in the TinyMCE editor is not (for me at least).
Browsing throught the source there is a lot of legacy stuff, so it is hard to see what is used, and what is not. Most examples I find are for TinyMCE 3.x, but it seems Umbraco 7 uses TinyMCE 4.1.
Does anyone know where to start? (or even better, have done the same thing :-)
Thanks. That could be a solution, but it would be a bit of a compromise.
I've seen how this works in Wordpress, and that is a much nicer experience.
The macro would however also cover another problem with the Umbraco RTE at the moment: Once you have inserted an image, it is not possible to edit the alt-text (as far as I can tell).
Well, at the current state of Umbraco, that might be true, but I really think it is suboptimal that it should require a macro to insert an image and define its aligment, size and caption. Macros also don't display as nicely in the RTE, especially if you where to define floating images.
Adding caption to images inserted in the RTE
I'm trying to add a caption to images inserted into the TinyMCE editor (using the alt-text as the text). Doing it in front end output is fairly easy using javascript, but getting it displayed in the TinyMCE editor is not (for me at least).
Browsing throught the source there is a lot of legacy stuff, so it is hard to see what is used, and what is not. Most examples I find are for TinyMCE 3.x, but it seems Umbraco 7 uses TinyMCE 4.1.
Does anyone know where to start? (or even better, have done the same thing :-)
Hi Torben.
One way could be to create a macro partial that has a Mediapicker and a string for caption as parameters. Then allowing it to be rendered in RTE.
That way you dont need to mix with Umbraco source code that might be overwritten in future upgrades.
Take care, best of luck to you! / Dennis
Hi Dennis,
Thanks. That could be a solution, but it would be a bit of a compromise. I've seen how this works in Wordpress, and that is a much nicer experience.
The macro would however also cover another problem with the Umbraco RTE at the moment: Once you have inserted an image, it is not possible to edit the alt-text (as far as I can tell).
Best,
Torben
Sounds like a win for the Marco! :)
Take care!!
Well, at the current state of Umbraco, that might be true, but I really think it is suboptimal that it should require a macro to insert an image and define its aligment, size and caption. Macros also don't display as nicely in the RTE, especially if you where to define floating images.
Yes, you have a point. Im not sure however if this is due to Umbraco or TinyMCE. Maybe make a feature request?
Take care!
is working on a reply...