SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 2 down vote accepted

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.