Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have this code, yet nothing is displaying, am I making a stupid mistake somewhere? I just want to iterate through the entire site.
@inherits umbraco.MacroEngines.DynamicNodeContext@{ var homeNode = Model.AncestorOrSelf("HomePage"); if (homeNode!= null) { <ul> @foreach (var item in homeNode.Children) { <li> <a href="@item.Url">@item.Name</a> </li> } </ul> }}
Hii Psib3r
"HomePage" is your node name? or document type alias?
It should be your home page document type alias.
Oh dear, it helps to add the bodyText tag!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
List of pages
I have this code, yet nothing is displaying, am I making a stupid mistake somewhere? I just want to iterate through the entire site.
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
var homeNode = Model.AncestorOrSelf("HomePage");
if (homeNode!= null) {
<ul>
@foreach (var item in homeNode.Children) {
<li>
<a href="@item.Url">@item.Name</a>
</li>
}
</ul>
}
}
Hii Psib3r
"HomePage" is your node name? or document type alias?
It should be your home page document type alias.
Oh dear, it helps to add the bodyText tag!
is working on a reply...