Created
April 7, 2015 13:48
-
-
Save ps-team/f031cf95b11778a07b58 to your computer and use it in GitHub Desktop.
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 Contensis.Framework.Web | |
@using Contensis.Framework.Web.Search | |
@{ | |
string currentLetter = "A"; | |
if (Request.QueryString["letter"] != null) { | |
currentLetter = Request.QueryString["letter"]; | |
} | |
var allContentQuery = Query.Where("Property_IncludeInAtoZ").IsEqualTo("1"); | |
var allContent = new NodeFinder().Find(allContentQuery); | |
} | |
<nav class="atozNavigations"> | |
@for(char c = 'A'; c <= 'Z'; c++) { | |
var hasContentTest = from content in allContent where content.Data.Title.ToString().StartsWith(c.ToString()) select content; | |
if (hasContentTest.Count() > 0) { | |
if(c.ToString() == currentLetter) { | |
<a class="currentLetter" title="See content starting with @c" href="AtoZ.aspx?letter=@c">@c</a> | |
} else{ | |
<a href="AtoZ.aspx?letter=@c" title="See content starting with @c">@c</a> | |
} | |
} else { | |
<span class="noContent">@c</span> | |
} | |
} | |
</nav> | |
@foreach(ContentNode atozItem in allContent.Where(i => i.Title.StartsWith(currentLetter))){ | |
//Code to output listing goes here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment