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

  • As pointed out beliw, the key is to deploy the shared branding files to the 15 hive (_layouts) – Robert Lindgren Jul 19 '13 at 7:05
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"/>
| improve this answer | |
  • 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? – Prashant Lakhlani Jul 19 '13 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. – user1217169 Jul 19 '13 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.

| improve this answer | |
  • I know that solution, I want solution that doesn't involve creating wsp package – Prashant Lakhlani Jul 19 '13 at 7:21
  • PowerShell or a manual copy to the SharePoint hive :-). – Elio Struyf Jul 19 '13 at 7:25
0

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

| improve this answer | |
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?

| improve this answer | |

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.