Exemplo n.º 1
0
 public static MenuViewModel InitMenu()
 {
     var menu = new MenuViewModel();
     var content = UmbracoHelper.TypedContent(ConfigurationManager.AppSettings["SettingItemId"]);
     foreach (var c in content.Children)
     {
         switch (c.DocumentTypeAlias.ToLower())
         {
             case "footerfolder":
                 var footer = new Footer
                 {
                     Image = Helper.GetMediaPicker(c, "logo"),
                     Address = c.GetPropertyValue<string>("address", string.Empty),
                     ShortDes = c.GetPropertyValue<string>("shortdes", string.Empty),
                     Phone = c.GetPropertyValue<string>("phone", string.Empty),
                     CopyRight = c.GetPropertyValue<string>("copyright", string.Empty),
                     LinkItems = Helper.GetMultiLinkPicker(c, "relatedWebsite")
                 };
                 menu.Footer = footer;
                 break;
             case "menufolder":
                 AddMainMenu(menu.MenuItems, c);
                 menu.Banner = Helper.GetMediaPicker(c, "banner");
                 break;
             case "rightfolder":
                 AddSideBar(menu.SidebarItems, c);
                 break;
             case "memberfolder":
                 AddMembers(menu.Members, c);
                 break;
         }
     }
     return menu;
 }
Exemplo n.º 2
0
 private static void AddFooterMenu(Footer footer, IPublishedContent c)
 {
     footer.Image = Helper.GetMediaPicker(c, "logo");
     footer.Address = c.GetPropertyValue<string>("address", string.Empty);
     footer.ShortDes = c.GetPropertyValue<string>("shortdes", string.Empty);
     footer.CopyRight = c.GetPropertyValue<string>("copyright", string.Empty);
     footer.LinkItems = Helper.GetMultiLinkPicker(c, "relatedWebsite");
 }