Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Has anyone ever managed to implement dynamic master pages on a publishing site?

Something along the lines of the master page switching automatically depending the referrer or some other passed through variable.

E.g. If the referrer was Google use master page “style1.masterpage” or if the referrer was MSN use master page “style2.masterpage” instead.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The Communitiy Kit for SharePoint changes the master page dynamically. You can find a code sample in the latest CKS changset. Drill down to EBE -> CKS.EBE -> CKS.Blog. It is in the BlogHttpModule.cs in the BlogHttpModule_PreInit method. You will need to add the HttpModule to the web.config. For an example of that, check the WebAppFeatureReceiver.cs in the same project.

EDIT: Also, check out this answer for a blog post specific to this solution.

share|improve this answer
    
excellent, enough there to get me going. –  Rob Feb 10 '10 at 15:09

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.