@inherits umbraco.MacroEngines.DynamicNodeContext
@using System
@using System.Linq
@using System.Xml.Linq
@{
dynamic node = new umbraco.MacroEngines.DynamicNode(1121);
}
@foreach (dynamic group in node.Children.OrderBy("CreatedDate").Take(2))
{
<div class="column-holder">
@foreach (var item in group )
{
<div class="cell">
<h3>@item.Name</h3>
<em>@String.Format("{0:dddd, MMMM d yyyy}", item.EventDateTime) - Starts at @String.Format("{0:HH:mm}", item.EventDateTime)</em><br />
<span>@(Library.Truncate(Library.StripHtml(item.EventDescription), 50, true))</span>
<p class="readmore-link"><a href="@item.Url" class="link more">read more</a></p>
</div>
}
</div>
}
The following error I get when i try to run the above micro on homepage:
Error loading Razor Script ~/macroscripts/eventhomepage.cshtml Cannot implicitly convert type 'umbraco.MacroEngines.DynamicNode' to 'System.Collections.IEnumerable'. An explicit conversion exists (are you missing a cast?)