Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ps-team/7e53b502d42c9830f9b5bf680f9a7d86 to your computer and use it in GitHub Desktop.
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.
@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