예제 #1
0
        /// <summary>
        /// Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Process(GetRenderingsArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            args.Result = args.Result?.Where(r =>
                                             r.DeviceId == args.PageContext.Device.Id &&
                                             !r.IsLayoutRendering() &&
                                             !string.IsNullOrEmpty(r.Placeholder) &&
                                             r.Renderer != null);
        }
        /// <summary>
        ///     Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Process(GetRenderingsArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            if (args.Result != null)
            {
                return;
            }
            args.Result = args.PageContext.PageDefinition.Renderings;
        }
예제 #3
0
        /// <summary>
        ///     Processes the specified arguments.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public void Process(GetRenderingsArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            Sitecore.Context.Site.SetDisplayMode(DisplayMode.Normal, DisplayModeDuration.ResetAfterRequest);
            CorePipeline.Run("mvc.requestBegin", args);
            if (args.PageContext != null)
            {
                args.PageContext.Item = Sitecore.Context.Item ?? args.PageContext.Item;
            }
        }