Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves dynamic element content.
        /// </summary>
        /// <param name="settings">Contains element settings.</param>
        /// <param name="pageContext">Page context.</param>
        /// <param name="unitOfWork">Unit of work.</param>
        /// <returns>Element content.</returns>
        public IElementContent GetContent(IElementSettings settings, IPageContext pageContext, IUnitOfWork unitOfWork = null)
        {
            IDictionary <object, object> items = _webHelperService.GetItems();

            return(new TestimonialContent {
                PartialViewName = "Testimonial", Items = items
            });
        }
Ejemplo n.º 2
0
        public IElementContent GetContent(IElementSettings settings, IPageContext pageContext, IUnitOfWork unitOfWork = null)
        {
            // Get carousel content
            IDictionary <object, object> items = _webHelperService.GetItems();
            CarouselContent content            = new CarouselContent {
                PartialViewName = "Carousel", Pages = new List <Page>(), Items = items
            };

            // Populate pages
            foreach (CarouselSlide slide in ((CarouselSettings)settings).Slides)
            {
                Page page = null;
                if (slide.PageId.HasValue)
                {
                    page = _pageService.Read(slide.TenantId, slide.PageId.Value, unitOfWork);
                }
                content.Pages.Add(page);
            }

            // Return result
            return(content);
        }