Copied to clipboard

Flag this post as spam?

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


  • pantryfight 60 posts 84 karma points
    Jun 22, 2015 @ 00:16
    pantryfight
    0

    Captions for media picker images in RTE

    Hi all,

    I've got a request from a client to be able to add captions underneath images in the RTE. I'm just wondering what would be the best way to do this?

    Thanks

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Jun 22, 2015 @ 01:34
    Peter Gregory
    0

    Unfortunately there is no native way to do this in the RTE itself in an easy way.

    Current the best way to do this would be by using a Macro. This would allow you to pick the image and either retrieve a caption from the media item or provide a macro parameter for entering the image caption.

  • pantryfight 60 posts 84 karma points
    Jun 22, 2015 @ 01:37
    pantryfight
    0

    For now I've created an "image with caption" format. I insert an image, type some text immediately after it, and then select both the text and the image together and apply the format. To this wrapper I apply a background color and display: table, as well as display: table-cell to the image. This makes the wrapper the same width as the image.

    This seems to work well so far, but if there's a better way I'm all ears!

    I thought that using a macro would be an idea but have to put that on hold for the time being since macros in RTE are broken in 7.2.6. (http://issues.umbraco.org/issue/U4-6687)

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Jun 22, 2015 @ 01:39
    Peter Gregory
    0

    Yeah the way you are doing it is probably the most elegant if Macros are not available.

  • pantryfight 60 posts 84 karma points
    Jun 22, 2015 @ 01:40
    pantryfight
    0

    Thanks Peter!

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Jun 22, 2015 @ 01:42
    Peter Gregory
    0

    No worries hopefully they get the Macro insert but sorted. However i do like how you are doing it by taking advantage of the RTEs standard way of putting in styles using the span tags, but can see unless you are aware of that it is not so straight forward.

Please Sign in or register to post replies

Write your reply to:

Draft