Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using System;
- @using System.Linq;
- @using umbraco.BusinessLogic;
- @using umbraco.cms.businesslogic.web;
- @{
- int pageId = umbraco.presentation.UmbracoContext.Current.PageId.Value;
- Document doc = new Document(pageId);
- var properties = doc.GenericProperties;
- var slideshowProperties = properties.Where(x => x.PropertyType.TabId == 9).ToList();
- var newprop = slideshowProperties.GroupBy(x => x.PropertyType.Alias.Substring(0, 2));
- Dictionary<String, String> PropDictionary = new Dictionary<String, String>();
- foreach (var p in newprop)
- {
- int i = 1;
- String keyvalue = "";
- foreach (var c in p)
- {
- if (i == 1)
- {
- var key = c.Value.ToString();
- PropDictionary.Add(key, null);
- keyvalue = key;
- }
- if (i == 2)
- {
- if (PropDictionary.ContainsKey(keyvalue))
- {
- PropDictionary[keyvalue] = c.Value.ToString();
- }
- }
- i++;
- }
- }
- foreach (var key in PropDictionary)
- {
- <p>@key.Key</p>
- <p>@key.Value</p>
- }
- }
Add Comment
Please, Sign In to add comment