Question

I've created a custom page layout for a search center, and seem to be stuck with the fact that by default, a search center is limited to a subset of approved page layouts. Upon initial deployment of the solution you have to go to 'Site Template and Layouts' and add the new custom layout to the list of layouts the site is allowed to use.

Ideally I'd like to automate this process as part of the feature activation event receiver... is this possible?

Screenshot

Was it helpful?

Solution

Yup, via a FeatureReceiver, call PublishingSite.SetAvailablePageLayouts()

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.setavailablepagelayouts.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top