1

I'm developing a portal for clients in SP2010. Each client will have their own copy of the portal (a site collection) branding for them.

Currently I provision all the branding artifacts to the style library using a feature, for one client, but I want to make the deployment dynamic. I.e. the feature should be able to extract the client name from the URL and use that name to access an SQL config database to pull any necessary settings.

I've done this to populate lists, but I'm wondering how I would go about provisioning a different set of branding files within a feature, depending on the client name?

For example, the logo for client A would be branding/clientA/logo.png and for client B it would be branding/clientB/logo.png - only one logo should be provisioned at site collection creation.

It's like I want to programmatically rewrite the Elements.xml upon feature add. Maybe..

Any ideas?

P.S. I'm trying to avoid using PowerShell to do this

0

You can use JS. You can have all of these information inside you SQL database then have a Web Service, ask to it the information that you need it and apply the CSS that you need.

  • That sounds an interesting idea @Salvatore-Di-Fazio. Are you saying that I should deploy the branding files for all clients in the feature, then programmatically build the css file using JS? Can you give me a little more information about your proposition please? – lekant Jul 17 '13 at 12:38
  • yes, u are correct. You can deploy all the files somewhere (a hidden list can be a good solution so you have not to create your web service) and then by jQuery u can get the name of your client in a hidden value inside the rendered page, do a Ajax call before the rendering of the page, get your css from the list and create the correct link to the correct resource <link rel="stylesheet" type="text/css" href="currentClient .css" /> – Salvatore Di Fazio Jul 17 '13 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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