Represents the data structure of an Extension page. An ExtensionPageData consists of multiple instances of ContentAreaData
which then could contain multiple ContentFunctionData instances with various kinds of content or nested ContentAreaData and so on.
An Extension page uses the data structure held in a respective ExtensionPageData instance to render the page.
Namespace:
Dropit.Extension.Core
Examples
The following example shows how to create an Extension page and add new content functions to its content areas.
CopyC#
// load extension page collection PageTypeCollection pageTypes = Dropit.Extension.Global.ListExtensionPageTypes(); // load content function IList<ContentFunctionType> functionTypes = Dropit.Extension.Global.ListContentFunctionTypes(); // create an extension page ExtensionPageData page = ExtensionPageData.Create(PageReference.StartPage, pageTypes[0].ID); page.CurrentPage.PageName = "Test Page " + DateTime.Now; // create 1st content function: BLOCK ContentFunctionData block = ContentFunctionData.Create(page.CurrentPage.PageLink, functionTypes[0].FunctionTypeID); // get the left content area from the page ContentAreaData contentArea = page.GetContentAreas()[0]; // insert to the left content area at 0 contentArea.InsertContentFunction(block, 0); // create 2nd content function: TEXT ContentFunctionData text = ContentFunctionData.Create(page.CurrentPage.PageLink, functionTypes[1].FunctionTypeID); // get the right content area from the page contentArea = page.GetContentAreas()[1]; // insert to the right content area at 0 contentArea.InsertContentFunction(text, 0); // create 3rd content function: IMAGE ContentFunctionData image = ContentFunctionData.Create(page.CurrentPage.PageLink, functionTypes[2].FunctionTypeID); // get the left content area of content function BLOCK contentArea = block.GetContentAreas()[0]; // insert to the left content area at 0 contentArea.InsertContentFunction(image, 0); PageReference pageLink = page.Save(EPiServer.DataAccess.SaveAction.Publish, EPiServer.Security.AccessLevel.NoAccess);
Assembly: Dropit.Extension (in Dropit.Extension.dll) Version: 3.2.6.326
Syntax
| C# |
|---|
[SerializableAttribute] public class ExtensionPageData : IPageSource, IExtensionSource, IObjectStore<ExtensionPageData>, IExtensionTransfer<ExtensionPageData> |