I believe @node is of type UmbracoNode or something like that, this is not a dynamic node like in the built in Razor engine. So you have to revert back to the "old" way of doing it:
@node.GetProperty("previewContent").Value
If you want to use the dynamic "." notation, you could do it just fine without using uQuery, try something like (untested):
@{ var nodes = Library.ToDynamicXml(Model.GetPropertyValue("articlePreviews")); }
<ul>
@foreach (var node in nodes) {
<li>@node.previewContent</li>
}
</ul>
Accessing properties when using uQuery.GetNodesByXml
How do I access properties, I thought i'd just be able to use the . notation as below, but this gives me an error when trying to use previewContent.
@using uComponents.Core
@using uComponents.Core.uQueryExtensions
@{
string xml = uQuery.GetCurrentNode().GetProperty<string>("articlePreviews");
var nodes = uQuery.GetNodesByXml(xml);
<ul>
@foreach( var node in @nodes )
{
<li>
<h2>@node.Name</h2>
<div>@node.previewContent</div>
<a href="@node.Url">Learn more >></a>
</li>
}
</ul>
}
I believe @node is of type UmbracoNode or something like that, this is not a dynamic node like in the built in Razor engine. So you have to revert back to the "old" way of doing it:
If you want to use the dynamic "." notation, you could do it just fine without using uQuery, try something like (untested):
is working on a reply...