Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a text page with several text page's under them. Each text page has a bodyText property that is a rich text editor.
How can I list the body text from each of the children?
This:
<umbraco:Macro runat="server" language="cshtml"> @inherits umbraco.MacroEngines.DynamicNodeContext @foreach (var item in @Model.Children) { <div> <h2>@item.Name</h2> @Html.Raw(item.BodyText) </div> } </umbraco:Macro>
yeilds: Error loading Razor Script
The best overloaded method match for 'System.Web.WebPages.Html.HtmlHelper.Raw(string)' has some invalid arguments
simply putting:
@item.BodyText
yields: umbraco.MacroEngines.DynamicXml
How can I get the actual contents of the body text to render?
This is probably to do with the DynamicNode duck-typing your BodyText incorrectly because of some unhandled tag. Try this
@Html.Raw(item.BodyText.ToXml().ToString())
or
@Html.Raw(item.GetProperty("bodyText").Value)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
List child node's body text
I have a text page with several text page's under them. Each text page has a bodyText property that is a rich text editor.
How can I list the body text from each of the children?
This:
<umbraco:Macro runat="server" language="cshtml">
@inherits umbraco.MacroEngines.DynamicNodeContext
@foreach (var item in @Model.Children)
{
<div>
<h2>@item.Name</h2>
@Html.Raw(item.BodyText)
</div>
}
</umbraco:Macro>
yeilds: Error loading Razor Script
The best overloaded method match for 'System.Web.WebPages.Html.HtmlHelper.Raw(string)' has some invalid arguments
simply putting:
@item.BodyText
yields: umbraco.MacroEngines.DynamicXml
How can I get the actual contents of the body text to render?
This is probably to do with the DynamicNode duck-typing your BodyText incorrectly because of some unhandled tag. Try this
or
is working on a reply...