3

According to this Microsoft Office 365 Blog post the SharePoint CSOM (.Net, REST, JS) has been enhanced to support setting SPWeb.AlternateCssUrl:

http://blogs.office.com/2014/08/13/uservoice-driving-improvements-sharepoint-api

This was published on the Microsoft Download Center, with additional guidance, as the SharePoint 2013 and SharePoint Online solution pack for branding and site provisioning. With this new scenario, engineering had to ship three core new changes to the existing API:

Expose get and set of SPWeb.AlternateCssUrl via CSOM (.Net, REST, JS)

Unfortunately I currently don't have an Office 365 SharePoint Online site at my disposal, hence I cannot test if and how it works.

Also I checked the mentioned:

SharePoint 2013 and SharePoint Online solution pack for branding and site provisioning

but couldn't find any reference setting SPWeb.AlternateCssUrl via CSOM or JS.

The MSDN Office 365 Dev Center also comes up blank, even though the Blog post mentions the Office 365 API Preview:

You can use the SharePoint APIs in conjunction with the Office 365 APIs Preview by using the Azure Active Directory auth bearer token.

Anybody out there on the Interwebs tried it already or found additional documentation?

I'm hoping for a CSOM download somewhere containing the new APIs...

1

You can use this code from JS in your app.

  var context = SP.ClientContext.get_current(); 
  var web = context.get_web();
  web.set_alternateCssUrl('filepath.css');
  web.update();
  context.executeQueryAsync(successFunction, errorFunction);

credit to: https://gist.github.com/wictorwilen/d4e2435f336fcd5abff5

0

You need the V16 Client DLLS for SharePoint online - see Office365 Developer Patterns and Practices @ https://github.com/OfficeDev/PnP

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.