0

I am using sharepoint 2013 on premise.

I am working on an interesting project where we have created re-usable branding by separating color.css and all other css. For each site collection, 3 css files are same and 1 css file is different.

So, when I have some improvements in one of the three css that are common to all site collections, I have to go and update then in style library/en-us/themable folder of all site collections.

Is there any easy way to resolve this other than maintaining wsp package?

-- Updates --

I know there are two solutions in my case, either I need to create wsp, or powershell to copy it over to different locations. I want to know if there is any other way to do this in shareopint 2013, may be cross site collection publishing or any new feature?

Thank you all for the response

1
  • As pointed out beliw, the key is to deploy the shared branding files to the 15 hive (_layouts) Jul 19, 2013 at 7:05

4 Answers 4

1

Sorry I read to fast to see you didnt want a .wsp, but I cant see another way if you want it to be in several site collections, needs to be in the filesystem.

Like EStruyf said.

Create a new solution in VS.

Add a SharePoint "Layouts" mapped folder. Add a new folder there, and put your css into it.

Deploy the .wsp.

Refference the CSS in the masterpage like this:

<SharePoint:CSSLink ID="Branding" runat="server" Version="15" DefaultUrl="/_layouts/15/company/CSS/custom.css"/>
2
  • I am having theme tokens in css, so can't place it in _layouts, it must be in style library/en-us/themable. Do we have any other option? Jul 19, 2013 at 7:21
  • I don't know if this works, but maybe you could create a solution with a feature you activate on all site collections. And you could have a event receiver on that feature that puts the file into the themable folder of the site collection of the feature. Jul 19, 2013 at 7:53
0

What you can do is to create a separate solution for your common branding files, and deploy these files to the SharePoint Root.

2
  • I know that solution, I want solution that doesn't involve creating wsp package Jul 19, 2013 at 7:21
  • PowerShell or a manual copy to the SharePoint hive :-). Jul 19, 2013 at 7:25
0

You could use a powershell script to iterate over all site collections and programmatically update the css file.

0

Are the permissions the same across the site collections? At least for the Style Library? Could you not just refer two of the site collections to the other one for the standardised CSS files? I know this does not work with scripts but is it OK for CSS files?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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