Ejemplo n.º 1
0
        public System.Web.Mvc.ActionResult Section(GeneratedNavigationRenderingParameters args, RenderingActionArgs renderingArgs)
        {
            var rootItem = renderingArgs.DatasourceItem
                           ?? RenderingContext.Current.GetSectionLandingPage(RenderingContext.Current.PageContext.Item)
                           ?? RenderingContext.Current.PageContext.Item;

            var model = new SectionNavigationViewModel
            {
                RootItem        = new NavigableItem(rootItem),
                Levels          = args.NavigationLevels <= 0 ? 1 : args.NavigationLevels,
                IncludeTopLevel = args.IncludeTopLevel
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public System.Web.Mvc.ActionResult Primary(GeneratedNavigationRenderingParameters args, RenderingActionArgs renderingArgs)
        {
            var rootItem = renderingArgs.DatasourceItem ?? RenderingContext.Current.GetHomeItem();
            var model    = new MainNavigationViewModel
            {
                MenuItems = rootItem == null ? new NavigableItem[0] : new NavigableItem(rootItem).PrimaryNavChildren,
                Levels    = args.NavigationLevels <= 0 ? 3 : args.NavigationLevels,

                CssClass              = args.CssClass,
                TopLevelListClass     = args.TopLevelListClass,
                TopLevelListItemClass = args.TopLevelListItemClass,
                TopLevelLinkClass     = args.TopLevelLinkClass,
                ChildListClass        = args.ChildListClass,
                ChildListItemClass    = args.ChildListItemClass,
                ChildLinkClass        = args.ChildLinkClass
            };

            return(View(model));
        }