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?
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
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
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.
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
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
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
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
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
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
is working on a reply...