Copied to clipboard

Flag this post as spam?

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


  • Dibs 202 posts 991 karma points
    Jul 02, 2015 @ 21:35
    Dibs
    0

    render image from a macro added to a RTE

    Dear Umbraco forum Team

    can you render a media file from a Macro Parameter of a Macro added to a RTE ?

    if so, how ?

    Thanks Dibs

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 03, 2015 @ 07:01
    Dennis Aaen
    0

    Hi Dibs,

    I assume that you already have the macro that you want to add to the RTE. If this is the case then.

    Go the the developer section open up the macros folder, find the macro that render image from a macro as settings you will see to checkboxes.

    enter image description here

    Use in rich text editor and the grid and Render in rich text editor and the grid just set a tick in both, and you should be able to do what you want.

    Hope this helps,

    /Dennis

  • Dibs 202 posts 991 karma points
    Jul 03, 2015 @ 07:09
    Dibs
    0

    Thanks Dennis

    I forgot to say that i wanted to render the macro image (within the RTE on a child Page) onto a Parent Page.

    Dibs

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 03, 2015 @ 07:24
    Dennis Aaen
    0

    Hi Dibs,

    Sorry I am not sure that I understand what you exactly are trying to do so you want to put the macro on a child page and then render the image on the parent page?

    /Dennis

  • Dibs 202 posts 991 karma points
    Jul 03, 2015 @ 07:32
    Dibs
    0

    Hi Dennis

    Yes Dennis that's what i want to do.

    I have added a partial view navigation for child pages to the parent page. This works as normal.

    I want to use the images from the macro within the RTE on the child pages as thumbnails for the navigation on the parent page.

    Dibs

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jul 03, 2015 @ 07:47
    Dennis Aaen
    100

    Hi Dibs,

    Perhaps a stupid question. Could you just put the macro on the parent page, and the display the images that you want?

    /Dennis

  • Dibs 202 posts 991 karma points
    Jul 03, 2015 @ 09:11
    Dibs
    0

    Hi Dennis

    The macro has a few parameters one of them being media type. i just want to use razor syntax to retrieve only the image from the macro and add it to the parent page. Code below will render images on a parent page from child pages with properties within the doctype: @{ var selection = CurrentPage.Children("docType").Where("Visible"); }

    @foreach (var item in selection) {
    <a href="@item.Url"><img src="@Umbraco.Media(item.image).Url"><br/>@item.Name</a> }

    I want to replicate rendering the images onto a parent page with child pages that use a RTE with a macro rendering parameters which include a media type parameter

    hope this makes sense

    Dibs

Please Sign in or register to post replies

Write your reply to:

Draft