I have finally taken the time to assemble a (fully working) Dynamic Sharepoint Rebranding Module (DSRM). The idea is based on a HTTPModule that dynamically change the Master Page (and CSS) on the fly. This approach has several advantages but my initial requirements is that it should support:
Dynamic re-branding of Master Pages
Dynamic appending of custom CSS
Replacing one Master Page with another like default.master => company.master
Highly configureable from the web.config with a somewhat intuitive configuration model including priorities on matching.
Rebranding of Master/CSS via query string parameters (like ?PrinterFriendly=true).
Must be compatible with Publishing Pages (many HTTPModules branding attempts out there are not)
Must be compatible with Application Pages
Supports Add-on model for Interceptors like QueryStringInterceptor (included in Beta 0.0.2).
Web.config sample
NB: Sample is included in the binaries download.
First you need to register the new branding section like this:
Then this is how the actual branding section look likes:
And finally locate the <httpModule> section in the web.config and register the HTTPModule like this: