I have a document type of "info" I also have some custom properites.
infoTitle infoSummary infoBody
I want to retrieve all the documents of document type "info" and output the data.
Thanks
This simple razor macro should accomplish what you desire:
@{
// Get root node:
var root = Model.AncestorOrSelf();
// Get all descendants, filter by type:
var nodes = root.Descendants("info");
// Loop through the filtered nodes, displaying the properties:
<ul>
@foreach (var node in nodes)
{
<li>
<h2>@node.infoTitle</h2>
<div>@node.infoSummary</div>
<div>@node.infoBody</div>
</li>
}
</ul>
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With