Exemple #1
0
        public ActionResult GetContent()
        {
            var publishedContent = UmbracoContext.GetPublishedContentByType("page");

            var pages = publishedContent.Select(page => (Page)page).ToArray();

            var sectionList = new List <SectionItem>();
            var formGroups  = new List <FormGroup>();

            foreach (var page in pages)
            {
                foreach (var section in page.Sections)
                {
                    sectionList.Add(section);
                    formGroups.Add((FormGroup)section.Form);
                }
            }

            var mappedPages = mapper.Map <IEnumerable <Models.Page> >(pages);

            return(ToJson(mappedPages));
        }