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
Hi all,
Am working on an Intranet system and i would like to know how to display the Members Section Tree Node thats from "a-z".
I did get all the members Name from the whole section but here i want to display the alphabetic folder it resides.
@using System.Linq@using System.Xml@using umbraco.cms.presentation.Trees @{ foreach(Member item in members){ if(item.HasProperty("userFirstName") && item.getProperty("userFirstName").Value.ToString() != String.Empty){ @item @item.Text<br/> } } }
Any thoughts on this ?
http://stackoverflow.com/questions/18282335/linq-razor-script-to-an-a-z-index
few suggestions here.. depending on if you want to show empty letters... or just those in use. :-)
Hi Mike,
Thanks for the url and response. Yes indeed i did try something very similar but then didnt have time to finish working on it.
So far this is what i did
string alpha = "ABCDEFGHIJKLMNOPQRSTUVQXYZ"; for(int i= 0; i < 26; i++){ @alpha[i] }
Got this working. Here is the solution if someone have some issues someday.
var q = Request.QueryString["letter"]; var members = Member.GetAll; string alpha = "ABCDEFGHIJKLMNOPQRSTUVQXYZ"; <ul> @for (int i = 0; i < 26; i++){ <a href="?letter=@alpha[i]">@alpha[i]</a> } </ul> if (!String.IsNullOrEmpty(Request.QueryString["letter"])) { foreach (Member a in members.Where(x => x.Text.StartsWith(q, StringComparison.OrdinalIgnoreCase)).Where(y=>y.HasProperty("userFirstName") && y.getProperty("userFirstName").Value.ToString() != String.Empty).OrderBy(x=>x.getProperty("userFirstName").Value.ToString())){ @a.getProperty("userFirstName").Value.ToString() @a<br /> } } else{ foreach(Member a in members.Where(z=>z.HasProperty("userFirstName") && z.getProperty("userFirstName").Value.ToString() != String.Empty).OrderByDescending(x=>x.CreateDateTime)){ @a.Text @a<br /> } }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Member Tree Nodes
Hi all,
Am working on an Intranet system and i would like to know how to display the Members Section Tree Node thats from "a-z".
I did get all the members Name from the whole section but here i want to display the alphabetic folder it resides.
Any thoughts on this ?
http://stackoverflow.com/questions/18282335/linq-razor-script-to-an-a-z-index
few suggestions here.. depending on if you want to show empty letters... or just those in use. :-)
Hi Mike,
Thanks for the url and response. Yes indeed i did try something very similar but then didnt have time to finish working on it.
So far this is what i did
Got this working. Here is the solution if someone have some issues someday.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.