Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umbraco 7: Get all siblings from current page

@foreach (var item in Model.Content.Children.Where("Visible"))
            {
                <a title="@item.Name" href="@item.Url">@item.Name</a>
            }

This does not give the result I need.

Q: How can I get all the all siblings pages from current page?

like image 931
alex Avatar asked Dec 15 '22 20:12

alex


1 Answers

Try this:

@var siblings = Model.Content.Siblings()

@foreach (var item in siblings.Where(x => x.Id != Model.Content.Id))
{
    <a title="@item.Name" href="@item.Url">@item.Name</a>
}
like image 199
Digbyswift Avatar answered Dec 22 '22 01:12

Digbyswift