Hey guys...
I have a macro where i want to display a random node from umbraco, but it doesnt seem like I can use the Random() method? Any ideas to how I do this?
@* RAZOR *@
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
foreach (var item in @Model.NodeById(1399).Children.Where("NodeTypeAlias == \"FitnessAd\"").Random()) {
<div class="ad">
@Html.Raw(@item.fitnessAd)
</div>
}
}
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/35398-display-random-node