Ejemplo n.º 1
0
        public ActionResult FooterNavigation()
        {
            Item baseItem = SiteConfiguration.GetFooterLinksItem();
            List <SimpleNavigationItem> items = new List <SimpleNavigationItem>();

            foreach (Item footerLink in baseItem.Children)
            {
                Item i = Sitecore.Context.Database.GetItem(footerLink["Top Level Item"]);
                if (i != null && SiteConfiguration.DoesItemExistInCurrentLanguage(i))
                {
                    items.Add(new SimpleNavigationItem(i));
                }
            }

            return(View(items));
        }
Ejemplo n.º 2
0
        private void Page_Load(object sender, EventArgs e)
        {
            Sitecore.Diagnostics.Tracer.Info("Footer Navigation - Page Load");
            Sitecore.Diagnostics.Profiler.StartOperation("Footer Navigation - Page Load");

            Item        baseItem = SiteConfiguration.GetFooterLinksItem();
            List <Item> nodes    = new List <Item>();

            foreach (Item footerLink in baseItem.Children)
            {
                Item i = Sitecore.Context.Database.GetItem(footerLink["Top Level Item"]);
                if (i != null && SiteConfiguration.DoesItemExistInCurrentLanguage(i))
                {
                    nodes.Add(i);
                }
            }

            rptMenu.DataSource = nodes;
            rptMenu.DataBind();

            Sitecore.Diagnostics.Profiler.EndOperation("Footer Navigation - Page Load");
        }