Beispiel #1
0
        public ActionResult BodyBottom(RenderingActionArgs args)
        {
            var model = _modelBuilder.Build(args.RenderingContextItem,
                                            ThemeResourceLocationIDs.BodyBottom,
                                            new ID(args.PageContext.Device.Id),
                                            SiteScriptsFieldNames.SiteFootScript,
                                            PageScriptsFieldNames.PageFootScript);

            return(View(model));
        }
Beispiel #2
0
        public ActionResult BodyTop(RenderingActionArgs args)
        {
            var model = _modelBuilder.Build(args.RenderingContextItem,
                                            ThemeResourceLocationIDs.BodyTop,
                                            new ID(args.PageContext.Device.Id),
                                            null,
                                            null);

            return(View(model));
        }
        public ActionResult Fragment(RenderingActionArgs args)
        {
            var model = new FragmentModel
            {
                WebEditUrl = string.Format("/?sc_mode=edit&sc_itemid={0}&sc_lang={1}",
                                           HttpUtility.UrlEncode(args.DatasourceItem.ID.ToString()), args.DatasourceItem.Language)
            };

            return(View(model));
        }
Beispiel #4
0
        public ActionResult ResponsiveImage(ResponsiveImageRenderingParameters args, RenderingActionArgs renderingActionArgs)
        {
            var model = new ResponsiveImageViewModel
            {
                Item     = renderingActionArgs.DatasourceItem,
                CssClass = args.CssClass
            };

            if (args.ResponsiveImageProfile != null)
            {
                model.Profile = new ResponsiveImageProfile(args.ResponsiveImageProfile);
            }

            return(View(model));
        }
Beispiel #5
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));
        }
Beispiel #6
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));
        }