SPNavigationNodeCollection nodeColl = newSite.Navigation.QuickLaunch; SPGroupCollection groups = newSite.Groups; string groupnamesString = ";;;;"; foreach (SPGroup group in groups) { if (group.Name.Contains("Owner") || group.Name.Contains("Member")) groupnamesString += group.Name + ","; } //groupnamesString = groupnamesString.Substring(0, groupnamesString.Length - 1); //node.Properties.Add("Audience", ";;;;" + Group1+","+ Group2 +","+ Group3+","+etc... "" ); Console.WriteLine(groupnamesString); if (!string.IsNullOrEmpty(groupnamesString)) { foreach (SPNavigationNode node in nodeColl) { if (node.IsExternal == true && node.Title != "General") { if (node.Properties.ContainsKey("Audience")) { node.Properties["Audience"] = groupnamesString; } else { node.Properties.Add("Audience", groupnamesString); } node.Update(); } } newSite.Update(); }
Wednesday, December 10, 2014
Adding Target audience to sharepoint left navigation programatically
Subscribe to:
Post Comments (Atom)
Image noise comparison methods
1. using reference image technique - peak_signal_noise_ratio (PSNR) - SSI 2. non-reference image technique - BRISQUE python pac...
-
No Risk Details 1 Version Disclosure (ASP.NET) Description: This information can be found in HTTP Response Header w...
-
Some times, when working with the Multiline fields, they may occupy the whole page :-). We can solve this issue by introducing Expand-Coll...
-
Artificial Intelligence is the broader umbrella under which Machine Learning and Deep Learning come. And you can also see in the diagram th...
No comments:
Post a Comment