Repository navigation
Provisioning - Add support for ScheduledPublishDate ? #1935
|
Hi! Not sure if I should add this as a discussion or an issue, but here we are: Currently, I can't find any handling of the ScheduledPublishDate of an IPage object in the extraction or applying of a site template. (Except for a number of test cases.) If there are, could someone point me to that code? If my suspicion is correct, wouldn't it be nice to implement support for that in the page extraction parts? I do understand that even if a Page has a value for this property, this feature may not activated in the destination SharePoint site. This might be a special case to handle? Or will a ScheduledPublishDate simply be ignored by SharePoint if a page has a value but the site does not have Scheduling activated? Best regards |
Replies: 3 comments
|
For a post-provision step, the supported way to schedule a page is an explicit operation on the provisioned I’d avoid silently publishing immediately if the destination cannot schedule the page. A round-trip test should cover a future date, an expired date, and a destination library with scheduling off. In the meantime, storing the intended date alongside the template and applying it after provisioning gives you a place to decide how to handle those cases. |
|
Thanks for the answer! The approach to use IPage: SchedulePublishAsync(DateTime) would require my provisioning implementation to keep track of source and destination pages and for those with scheduled publishing to call SchedulePublishAsync(). Is there any way to hook into the post processing of PnP.Core.Provisioning to add specialized procedures like this? Best regards |
|
Makes sense — if you want to avoid tracking pages externally, another option is to store the target publish timestamp in a custom property/metadata field during the provisioning pass (or in a lightweight |
For a post-provision step, the supported way to schedule a page is an explicit operation on the provisioned
IPage:SchedulePublishAsync(DateTime). The PnP PowerShell equivalent documents that it enables scheduling on the Site Pages library when needed. That is a library-level change, so a template importer would need an explicit policy for that case.I’d avoid silently publishing immediately if the destination cannot schedule the page. A round-trip test should cover a future date, an expired date, and a destination library with scheduling off. In the meantime, storing the intended date alongside the template and applying it after provisioning gives you a place to decide how to handle thos…