Created
October 27, 2017 09:35
-
-
Save ps-team/7e53b502d42c9830f9b5bf680f9a7d86 to your computer and use it in GitHub Desktop.
Simple Razorview to list all sibling pages in a folder and exclude the folder homepage using meta data to generate the link title.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Collections.ObjectModel | |
@using Contensis.Framework.Web | |
@{ | |
// links in containing folder | |
ReadOnlyCollection<ContentNode> nodes = CurrentNode.Siblings(false); | |
// render - links if they exist | |
if(nodes.Count > 0) | |
{ | |
<ul> | |
@foreach(ContentNode node in nodes) | |
{ | |
<li> | |
<a href="@node.Path" title="@node.Data.MD_LinkTitle">@node.Title</a> | |
</li> | |
} | |
</ul> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment