public Legends_AllType GetAllLegends(string path) { Legends_AllType allType = new Legends_AllType(); allType.legends_All = new List <Models.Legends>(); Database DB = Sitecore.Context.Database; Sitecore.Data.Items.Item legendsItem = DB.GetItem(path); foreach (Sitecore.Data.Items.Item child in legendsItem.Children) { Legends legendInfoAll = new Legends(); legendInfoAll.icon = child.Fields[Templates.LegendInformation.LegendIcon]; legendInfoAll.imageURL = Sitecore.Resources.Media.MediaManager.GetMediaUrl(legendInfoAll.icon.MediaItem); legendInfoAll.subtitle = child.Fields[Templates.LegendInformation.LegendSubtitle].ToString(); allType.legends_All.Add(legendInfoAll); } return(allType); }
public ActionResult TrainPosition() { Legends_AllType modelFull = GetAllLegends("/sitecore/content/Home/iMap/Configuration/TrainPosition/"); return(View(modelFull)); }