public InternalLayout GetInternalLayout()
        {
            EnsureInitialized();

            var layout = new InternalLayout();

            layout.PlaceHolderIds.Add(nameof(PageTypeSpecificSettingsPlaceHolder));

            var selected = GetSelectedFormFromQuerystring();

            if (selected == null)
            {
                return(layout);
            }

            var pgContent = new PageContent
            {
                Id = new Guid("b8029034-01db-47fe-8db8-3a1700d9caf1"), //doesn't matter what this is, but it needs to be consistent (i think?)
                PlacementContentPlaceHolderId = nameof(PageTypeSpecificSettingsPlaceHolder),
                WidgetTypeCode = DynamicForm.ApiId,
                Parameters     = new Dictionary <string, string> {
                    ["FormId"] = selected.ToString()
                }
            };

            layout.DefaultContent.Add(pgContent);
            return(layout);
        }
        public InternalLayout GetInternalLayout()
        {
            var internalLayout = new InternalLayout();

            for (int i = 0; i < NumColumns; i++)
            {
                internalLayout.PlaceHolderIds.Add(i.ToString());
            }

            return(internalLayout);
        }
示例#3
0
        public InternalLayout GetInternalLayout()
        {
            EnsureLayoutInitialized();

            var internalLayout = new InternalLayout();

            for (var i = 0; i < NumColumns; i++)
            {
                internalLayout.PlaceHolderIds.Add(i.ToString());
            }

            return(internalLayout);
        }
        public InternalLayout GetInternalLayout()
        {
            EnsureLayoutInitialized();

            var layout = new InternalLayout();

            layout.PlaceHolderIds.Add(nameof(surface));

            var formRepository = new FormRepository();

            _cmsForm = formRepository.FindContentVersions(By.ContentId(FormId), ContentEnvironment.Live).Result.Single();

            foreach (var item in _cmsForm.ChildNodes)              //todo: better way.
            {
                item.PlacementContentPlaceHolderId = nameof(surface);
            }

            layout.DefaultContent.AddRange(_cmsForm.ChildNodes.Select(x => PresentationElementHelpers.ToPresentationElement(x)));
            return(layout);
        }