How to render child content item directly in the parent.
Hi,
in my view, I am looping through the children of a content item. This item is from type DynamicPublishedContent.
How can I directly render this child item in the current template?
There is an associated template with the Document type and I just want to render it.
foreach (var rightItem in rightContainer.Children)
{
@rightItem
<br/>
}
as an alternative if you want to use the template if the Childs have a look at the RenderTemplate-method of the umbraco helper. This should render the template directly.
How to render child content item directly in the parent.
Hi,
in my view, I am looping through the children of a content item. This item is from type DynamicPublishedContent.
How can I directly render this child item in the current template? There is an associated template with the Document type and I just want to render it.
Regards, Boris
Hi,
In order to render the child items inside the parent, you can use partial views (as technically you are only rendering a part of the page.
The example for partial views in the documentation actually shows how to render child items and is probably what you are looking for.
Hi Boris,
as an alternative if you want to use the template if the Childs have a look at the RenderTemplate-method of the umbraco helper. This should render the template directly.
Regards David
That sounds nice, David
Thanks, Boris
is working on a reply...