I was wondering if anyone have a neat way of inserting image descriptions on images whos inserted in the Richtext Editor.
On every image in my media library, I have made up a mandatory field (description) to write a small description. This description-field is also used for the alt-tag on the images if they are inserted via the media picker.
But in the Richtext Editor I can't figure out a smart way of inserting some sort of description under each inserted image. It could be very nice if the content of the description-field could be placed under the right image. Is there a way of doing that?
I just thought that I couldn't be the only one with this kind of issue.
Yeah that would actually be possible, but how can I then make sure that the text is being placed right under the image? And if there will be inserted more that one image, the right text should be placed under the matching image.
It's not important that it's the text from the "description"-field that written under each image. It's also fine if it could be written when the image is inserted, or take it from the title-/alt-attribute on the image.
We always try to avoid letting clients put images into the RTE, this way if gives us greater control of mark up, generally clients and the RTE are a bad mix.
Prehaps you could think about this in another way, image as a separate node, image as a property etc.
We have too some templates with images in separate properties but the problem is that we have some other templates where users need RTE to insert a lot of pictures (we can´t fix the number in the template because it´s variable).
Also these templates work much better about the performance because with more than 20 properties the editors performance is quite bad. Don´t you have this problem in your website?
Sometimes we'll use a child node for an image (then they can have as many as they need) other times we use a Multi Node Tree Picker to select images, it depends on the your design?
It´s a good idea but our website it´s a migration from a very old MCMS2002 website and in the first phase we have to keep exactly the structure from the old website (templates and placeholders), so we can´t make this arquitecture updates because we would have a problem with the old content.
That was my first idea but I wanted to be sure that there wasn´t any other easier and smarter way. I guess I would have to detect all the images in the RTE (using C# and regular expressions), search for them in the Media Library (Umbraco API), get the "alt" property and update the string text content for the RTE.
Insert of image description in RTE.
I was wondering if anyone have a neat way of inserting image descriptions on images whos inserted in the Richtext Editor.
On every image in my media library, I have made up a mandatory field (description) to write a small description. This description-field is also used for the alt-tag on the images if they are inserted via the media picker.
But in the Richtext Editor I can't figure out a smart way of inserting some sort of description under each inserted image. It could be very nice if the content of the description-field could be placed under the right image. Is there a way of doing that?
I just thought that I couldn't be the only one with this kind of issue.
You can create macros that can be executed from the "umbarco macro" button in the RTE.
I think it should be possible to create a macro that gets the text and insert it in the RTE.
Mikael
Yeah that would actually be possible, but how can I then make sure that the text is being placed right under the image? And if there will be inserted more that one image, the right text should be placed under the matching image.
It's not important that it's the text from the "description"-field that written under each image. It's also fine if it could be written when the image is inserted, or take it from the title-/alt-attribute on the image.
Hi Kim,
I have exactly the same situation.
Did you solve it?
Hi,
We always try to avoid letting clients put images into the RTE, this way if gives us greater control of mark up, generally clients and the RTE are a bad mix.
Prehaps you could think about this in another way, image as a separate node, image as a property etc.
Rich
Hi Rich,
We have too some templates with images in separate properties but the problem is that we have some other templates where users need RTE to insert a lot of pictures (we can´t fix the number in the template because it´s variable).
Also these templates work much better about the performance because with more than 20 properties the editors performance is quite bad. Don´t you have this problem in your website?
Hi,
Sometimes we'll use a child node for an image (then they can have as many as they need) other times we use a Multi Node Tree Picker to select images, it depends on the your design?
Rich
It´s a good idea but our website it´s a migration from a very old MCMS2002 website and in the first phase we have to keep exactly the structure from the old website (templates and placeholders), so we can´t make this arquitecture updates because we would have a problem with the old content.
Hi,
You could do some dirty matching of images in the RTE before you render to the page to see if you can match the image and therfore the alt tag.
Alternatively you might write some JQuery to the page to do this too?
Rich
That was my first idea but I wanted to be sure that there wasn´t any other easier and smarter way. I guess I would have to detect all the images in the RTE (using C# and regular expressions), search for them in the Media Library (Umbraco API), get the "alt" property and update the string text content for the RTE.
About JQuery, I have never used it :-(
using this you should be able to grab the images quickly
http://htmlagilitypack.codeplex.com/
Rich
Thanks Rich!
I´ll have a look at this when I have some time.
is working on a reply...