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 am using the following script to output my subnav. Is there a way to order the pages? A drag and drop would be nice.
<umbraco:Macro runat="server" language="cshtml">@{ var currentPage = Model; while (currentPage.Level>2) { currentPage=currentPage.Parent; } <ul class="subnav"> @foreach (var c in currentPage.Children) { <li><a href="@c.Url">@c.Name</a></li> } </ul> }</umbraco:Macro>
Hii Rocoeh.
You can sort your page from content section - right click on your parent node and then - "sort".
Another issue - you can replace this : var currentPage = Model; while (currentPage.Level>2) { currentPage=currentPage.Parent; }
with this:
<ul class="subnav"> @foreach (var c in Model.AncestorOrSelf(1).Children) { <li><a href="@c.Url">@c.Name</a></li> } </ul>
Hi Rocoeh,
You can sort your order like this
@{var c = Model.AncestorOrSelf(1).Children.OrderBy("createDate descending");}
//fuji
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Ordering sub nav
I am using the following script to output my subnav. Is there a way to order the pages? A drag and drop would be nice.
<umbraco:Macro runat="server" language="cshtml">
@{
var currentPage = Model;
while (currentPage.Level>2) { currentPage=currentPage.Parent; }
<ul class="subnav">
@foreach (var c in currentPage.Children)
{
<li><a href="@c.Url">@c.Name</a></li>
}
</ul>
}
</umbraco:Macro>
Hii Rocoeh.
You can sort your page from content section - right click on your parent node and then - "sort".
Another issue - you can replace this :
var currentPage = Model;
while (currentPage.Level>2) { currentPage=currentPage.Parent; }
with this:
<ul class="subnav">
@foreach (var c in Model.AncestorOrSelf(1).Children)
{
<li><a href="@c.Url">@c.Name</a></li>
}
</ul>
Hi Rocoeh,
You can sort your order like this
//fuji
is working on a reply...