Create a new page when publishing another

Hi. I'm trying to create a page when publishing another. The new page is supposed to be set with the same pagetype, and with the "Fetch Data from" set on. I'm using EPiServer 4.60. I've discovered that I need to set the newPage.LinkType = PageShortcutType.FetchData. But where do I go from here? I try to set the PageLink property to point to the original page, but this results in that I'm actually editing on the original page, and the new page never gets created. Anyone got a tip? Frank :)
Sep 21, 2006 22:49
The two properties you want to set would be PageShortcutType and PageShortcutLink. For example if you were doing this in the DataFactory PagePublished event you could do the following. if (e.Page.LinkType != PageShortcutType.FetchData) { PageData newPage = Global.EPDataFactory.GetDefaultPageData(e.Page.ParentLink, e.Page.PageTypeID); newPage.Property["PageShortcutType"].Value = PageShortcutType.FetchData; newPage.Property["PageShortcutLink"].Value = e.PageLink; Global.EPDataFactory.Save(newPage, EPiServer.DataAccess.SaveAction.Publish); }
Sep 22, 2006 1:23
Thanks! That did the trick. Frank :D
Sep 22, 2006 7:50
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.