/// <summary> /// Creates a new page content items /// </summary> /// <param name="pageName">Name of the page</param> /// <param name="group">String id of the group the page belongs to. Use this to distinct between a set of pages.</param> /// <param name="initializer">Delegate to run immediately after the page item is created</param> /// <param name="eventHandler">Page event handler</param> public static IContent NewPage(this IContentManager contentManager, string pageName, string group, Action<IContent> initializer, IPageEventHandler eventHandler) { var page = contentManager.New(contentManager.CreatePageName(pageName, group)); initializer(page); var context = new PageContext(page, group); eventHandler.OnPageInitializing(context); eventHandler.OnPageInitialized(context); return page; }
public void OnPageInitializing(PageContext pageContext) { if (!pageContext.Page.IsPage("Testbed", PageConfigs.AdminGroup)) return; pageContext.Page.Weld<ScriptingAdminTestbedPart>(); }