Reputation: 29444
This is what I am doing
This is the code circled red (where it throws an error):
@foreach (var slide in Model.Children)
I thought you used to be able to do something like that in Umbraco 4.7.
How do you loop through the child nodes correctly in Umbraco 7?
Upvotes: 2
Views: 5273
Reputation: 1784
You have access to CurrentPage which is a dynamic Umbraco model.
So like
@foreach (var slide in CurrentPage.Children)
{
<p>@slide.Name</p>
}
On side node: Instead of using Umbraco.Field("pageName"), Use CurrentPage.PageName.
Upvotes: 5