Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 01, 2009 @ 08:50
    Kim Andersen
    0

    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.

  • Mikael Mørup 297 posts 326 karma points
    Oct 01, 2009 @ 09:26
    Mikael Mørup
    0

    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

  • Kim Andersen 1447 posts 2197 karma points MVP
    Oct 01, 2009 @ 09:38
    Kim Andersen
    0

    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.

  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 10:30
    Sergio
    0

    Hi Kim,

    I have exactly the same situation.

    Did you solve it?

  • Rich Green 2246 posts 4008 karma points
    Dec 22, 2011 @ 10:34
    Rich Green
    0

    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

  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 10:41
    Sergio
    0

    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?

  • Rich Green 2246 posts 4008 karma points
    Dec 22, 2011 @ 10:46
    Rich Green
    0

    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

  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 10:49
    Sergio
    0

    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.

  • Rich Green 2246 posts 4008 karma points
    Dec 22, 2011 @ 10:50
    Rich Green
    0

    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 

  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 11:10
    Sergio
    0

    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 :-(

  • Rich Green 2246 posts 4008 karma points
    Dec 22, 2011 @ 11:13
    Rich Green
    0

    using this you should be able to grab the images quickly

    http://htmlagilitypack.codeplex.com/

    Rich

  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 12:08
    Sergio
    0

    Thanks Rich!

    I´ll have a look at this when I have some time.

Please Sign in or register to post replies

Write your reply to:

Draft