public string PageLayoutClass() { Item pres = SiteConfiguration.GetSiteConfigurationItem(); if (pres != null) { return(pres["Layout Style"].ToLower().Replace(" ", "-")); } return(null); }
public string CssTheme() { Item pres = SiteConfiguration.GetSiteConfigurationItem(); if (pres != null) { return(String.Format("<link rel=\"stylesheet\" href=\"/assets/css/colors/color_scheme_{0}.css\" />", pres.Fields["Site Color"].Value.ToLower())); } return(null); }
public string TopLineClass() { Item pres = SiteConfiguration.GetSiteConfigurationItem(); if (pres != null) { return(pres["Show Top Line"] == "1" ? "top_line" : "top_line_plain"); } return("top_line"); }
// GET: Navigation public ActionResult Header() { // This page is setting a lot fo the presentation details. This is due tot he flexible nature of this site. Item presentationSettings = SiteConfiguration.GetSiteConfigurationItem(); if (presentationSettings != null) { return(PartialView("Header", presentationSettings)); } return(null); }
private string GetColor(string fieldName) { Item pres = SiteConfiguration.GetSiteConfigurationItem(); if (pres != null) { Sitecore.Data.Database d = Sitecore.Context.ContentDatabase ?? Sitecore.Context.Database; Item i = d.GetItem(pres[fieldName]); if (i != null) { return(i["Color Value"]); } } return(null); }
public string PageTitle() { Item siteSettings = SiteConfiguration.GetSiteConfigurationItem(); Item home = SiteConfiguration.GetHomeItem(); Item currentItem = Sitecore.Context.Item; if (Sitecore.Context.Item.ID == home.ID || Sitecore.Context.Item.ParentID == home.ID) { return(String.Format(siteSettings["Page Title for Home and Site Sections"], currentItem["Menu Title"])); } else { Item section = currentItem.Parent; while (section.ParentID != home.ID) { section = section.Parent; } return(String.Format(siteSettings["Page Title for Lower Pages"], currentItem["Menu Title"], section["Menu Title"])); } }
public List <PatternMatch> LoadPatterns() { List <PatternMatch> patternMatches = new List <PatternMatch>(); if (Tracker.IsActive) { if (SiteConfiguration.GetSiteConfigurationItem() != null) { MultilistField profiles = SiteConfiguration.GetSiteConfigurationItem().Fields["Visible Profiles"]; foreach (Item visibleProfile in profiles.GetItems()) { Item visibleProfileItem = Sitecore.Context.Database.GetItem(visibleProfile.ID); if (visibleProfileItem != null) { // show the pattern match if there is one. var userPattern = Tracker.Current.Interaction.Profiles[visibleProfileItem.Name]; if (userPattern != null) { // load the details about the matching pattern if (userPattern.PatternId.HasValue) { Item matchingPattern = Sitecore.Context.Database.GetItem(userPattern.PatternId.ToId()); if (matchingPattern != null) { Sitecore.Data.Items.MediaItem image = new Sitecore.Data.Items.MediaItem( ((ImageField)matchingPattern.Fields["Image"]).MediaItem); string src = Sitecore.StringUtil.EnsurePrefix('/', Sitecore.Resources.Media.MediaManager.GetMediaUrl(image)); patternMatches.Add(new PatternMatch(visibleProfileItem["Name"], matchingPattern.Name, src)); } } } } } } } return(patternMatches); }
public ActionResult NavigationBar() { Item presentationSettings = SiteConfiguration.GetSiteConfigurationItem(); return((presentationSettings != null) ? View(presentationSettings) : null); }