public string CssTheme()
        {
            Item pres = SiteConfiguration.GetPresentationSettingsItem();

            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);
        }
Exemple #2
0
        public string PageLayoutClass()
        {
            Item pres = SiteConfiguration.GetPresentationSettingsItem();

            if (pres != null)
            {
                return(pres["Layout Style"].ToLower().Replace(" ", "-"));
            }
            return(null);
        }
Exemple #3
0
        protected void Page_Init(object sender, EventArgs e)
        {
            HtmlLink css = new HtmlLink();

            css.Href = String.Format("/assets/css/colors/color_scheme_{0}.css", SiteConfiguration.GetPresentationSettingsItem()["Site Color"]).ToLower();
            css.Attributes["rel"]   = "stylesheet";
            css.Attributes["type"]  = "text/css";
            css.Attributes["media"] = "all";
            litCssHolder.Controls.Add(css);
        }
Exemple #4
0
        public string TopLineClass()
        {
            Item pres = SiteConfiguration.GetPresentationSettingsItem();

            if (pres != null)
            {
                return(pres["Show Top Line"] == "1" ? "top_line" : "top_line_plain");
            }
            return("top_line");
        }
Exemple #5
0
        /* The theme for Launch Sitecore includes a few attributes to enable variations within the site. These methods support this. */
        public string BodyClass()
        {
            Item pres = SiteConfiguration.GetPresentationSettingsItem();

            if (pres != null && pres["Background Image"] != string.Empty)
            {
                ImageField imgField = ((Sitecore.Data.Fields.ImageField)pres.Fields["Background Image"]);
                return(imgField.MediaItem.Parent.Key == "patterns" ? "background-pattern" : "background-cover");
            }
            return(null);
        }
Exemple #6
0
        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.GetPresentationSettingsItem();

            if (presentationSettings != null)
            {
                return((presentationSettings["Logo Location"] == "Header") ? View("HeaderWithLogo", presentationSettings) : View("HeaderWithoutLogo"));
            }
            return(null);
        }
Exemple #7
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // This page is setting a lot fo the presentation details.  This is due tot he flexible nature of this site.
            Item PresentationSettings = SiteConfiguration.GetPresentationSettingsItem();

            // Set the page logo
            if (PresentationSettings["Logo Location"] == "Header")
            {
                Logo.Item = PresentationSettings;
            }
            else
            {
                Logo.Visible     = false;
                logospan.Visible = false;
                tertiarynavspan.Attributes.Add("class", "span12");
            }

            // set the page layout
            out_container.Attributes.Add("class", PresentationSettings["Layout Style"].ToLower().Replace(" ", "-"));

            // Show/Hide the top line
            if (PresentationSettings["Show Top Line"] != "1")
            {
                topline.Attributes.Add("class", "top_line_plain");
            }

            // set the background image / color
            if (PresentationSettings["Background Image"] != string.Empty)
            {
                ImageField imgField = ((Sitecore.Data.Fields.ImageField)PresentationSettings.Fields["Background Image"]);
                mainbody.Style.Add("background-image", MediaManager.GetMediaUrl(imgField.MediaItem));

                if (imgField.MediaItem.Parent.Key == "patterns")
                {
                    mainbody.Attributes.Add("class", "background-pattern");
                }
                else
                {
                    mainbody.Attributes.Add("class", "background-cover");
                }
            }
            else if (PresentationSettings["Background Color"] != string.Empty)
            {
                mainbody.Style.Add("background-color", PresentationSettings["Background Color"]);
            }

            Copyright.Item = SiteConfiguration.GetSiteSettingsItem();
        }
Exemple #8
0
        public string BodyStyle()
        {
            Item pres = SiteConfiguration.GetPresentationSettingsItem();

            if (pres != null)
            {
                if (pres["Background Image"] != string.Empty)
                {
                    ImageField imgField = ((Sitecore.Data.Fields.ImageField)pres.Fields["Background Image"]);
                    return(String.Format("background-image: url('{0}')", MediaManager.GetMediaUrl(imgField.MediaItem)));
                }
                else if (pres["Background Color"] != string.Empty)
                {
                    return(String.Format("background-color: {0}", pres["Background Color"]));
                }
            }
            return(null);
        }
Exemple #9
0
        private void LoadMenu()
        {
            Item presentation = SiteConfiguration.GetPresentationSettingsItem();

            if (presentation != null && presentation["Main Menu Type"] == "Inverse")
            {
                navbar.Attributes.Add("class", "navbar navbar-inverse");
            }

            // Set the page logo
            if (presentation["Logo Location"] == "Navigation Bar")
            {
                Logo.Item             = presentation;
                BrandLink.CssClass    = "brand logobrand";
                BrandLink.NavigateUrl = LinkManager.GetItemUrl(SiteConfiguration.GetHomeItem());
            }
            else
            {
                BrandLink.Text        = GetDictionaryText("navigate");
                BrandLink.NavigateUrl = "#";
                Logo.Visible          = false;
            }


            HomeItem = SiteConfiguration.GetHomeItem();
            List <Item> nodes = new List <Item>();

            if (HomeItem["Show Item In Menu"] == "1")
            {
                nodes.Add(HomeItem);
            }
            foreach (Item i in HomeItem.Children)
            {
                if (SiteConfiguration.DoesItemExistInCurrentLanguage(i) && i["Show Item In Menu"] == "1")
                {
                    nodes.Add(i);
                }
            }
            rptDropDownMenu.DataSource = nodes;
            rptDropDownMenu.DataBind();
        }
Exemple #10
0
        public ActionResult NavigationBar()
        {
            Item presentationSettings = SiteConfiguration.GetPresentationSettingsItem();

            return((presentationSettings != null) ? View(presentationSettings) : null);
        }