Hvorfor får sider som legges til i Global.asax.cs på denne måten:
private void EPDataFactory_LoadingChildren(object sender, EPiServer.ChildrenEventArgs e)
{
EPiServer.Core.PageData _activePage = EPiServer.Global.EPDataFactory.GetPage(e.PageLink);
if (_activePage.LinkURL.ToLower().IndexOf("triggerPage.aspx") > 0)
{
EPiServer.Core.PageData newPage = Global.EPDataFactory.GetDefaultPageData((EPiServer.Core.PageReference) e.PageLink, 3);
newPage.Property["PageName"] = new PropertyString("created in global.asax");
newPage.Property["PageVisibleInMenu"] = new PropertyBoolean(true);
newPage.Property["PagePendingPublish"] = new PropertyBoolean(false);
newPage.Property["PageLinkURL"] = new PropertyString("/VOX/templates/Page.aspx?id=102");
newPage.Property["PageStartPublish"] = new PropertyDate(_activePage.StartPublish);
newPage.Property["PageLink"] = new PropertyPageReference(new PageReference(110));
newPage.Indent = _activePage.Indent + 1;
e.Children.Add(newPage);
}
}
status 'siden er ikke publisert'? Skulle ikke PagePendingPublish=false unngå dette?
Thomas, Gazette as
Egenskapen PageWorkStatus måste sättas till VersionStatus.Published också.
Tänk förövrigt på att GetDefaultPageData kommer generera tex sidans katalog dynamiskt så du bör cacha din nyskapade sida för att inte få prestandaproblem.
private void EPDataFactory_LoadingChildren(object sender, EPiServer.ChildrenEventArgs e) { EPiServer.Core.PageData _activePage = EPiServer.Global.EPDataFactory.GetPage(e.PageLink); if (_activePage.LinkURL.ToLower().IndexOf("triggerPage.aspx") > 0) { EPiServer.Core.PageData newPage = Global.EPDataFactory.GetDefaultPageData((EPiServer.Core.PageReference) e.PageLink, 3); newPage.Property["PageName"] = new PropertyString("created in global.asax"); newPage.Property["PageVisibleInMenu"] = new PropertyBoolean(true); newPage.Property["PagePendingPublish"] = new PropertyBoolean(false); newPage.Property["PageLinkURL"] = new PropertyString("/VOX/templates/Page.aspx?id=102"); newPage.Property["PageStartPublish"] = new PropertyDate(_activePage.StartPublish); newPage.Property["PageLink"] = new PropertyPageReference(new PageReference(110)); newPage.Indent = _activePage.Indent + 1; e.Children.Add(newPage); } }
status 'siden er ikke publisert'? Skulle ikke PagePendingPublish=false unngå dette? Thomas, Gazette as