Friday, 19 December 2014

SharePoint publishing pages: Prompting the user when they might lose changes

Yes, so first of all apologies for the slightly wordy and not particularly "on point" title for this post - I can't quite how to name it, hence the above...

The problem

Anyway, what this post is about is how to give users creating and editing publishing pages in SharePoint a better experience when leaving a page that is in edit mode. This arose from a customer complaining that if they accidentally (or even purposely) click on the back button, or hit F5 or even click on a link somewhere whilst editing a page they get whisked away without a shadow of a warning meaning that there will be a high chance of losing any unsaved work.

I wanted a quick a dirty solution for this scenario that works in SharePoint Online, which means JavaScript. I'm not claiming that what I'm about to show you is the best possible way to manage this, but it works and the customer was really happy that I was able to throw a solution together for them so quickly.

Wednesday, 3 December 2014

SharePoint Online Variations in an existing site and redirecting from the root site

I've had occasion to refresh my knowledge of the variations features in SharePoint Online recently and ran into an 'issue' that I thought I'd (a) share and (b) record for future reference.

There are plenty of decent guides to the basic setup approach for variation labels, etc. out in the ether of the internet already (this is my reference article), so I won't go over that again here, but I had to work through a scenario where an existing site collection, already used as a publishing site, needs to have variation sites created beneath it.

Friday, 3 October 2014

SharePoint Online: ensuring sp.js (or any other scrip library) is loaded

Load By Sod to the rescue!

Came across a nice gotcha this afternoon whilst trying to diagnose why some javascript in a content editor wasn't firing correctly on system settings pages (it's a terms and conditions agreement pop-up dialogue that must display the first time a user hits the site whatever their entry page).

Tuesday, 24 June 2014

SharePoint Online error - Connect-SPOService : For security reasons DTD is prohibited in this XML document.

The lovely error in full

Connect-SPOService : For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method. 
At line:1 char:1
+ Connect-SPOService -Url -Credential
adminuser@XXXXX ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-SPOService], XmlExcep
    + FullyQualifiedErrorId : System.Xml.XmlException,Microsoft.Online.SharePo int.PowerShell.ConnectSPOService

Diagnosing the problem

So I was fiddling around with my new work laptop from home the other day and came across this error. Obviously my first port of call was the universal error solving service known as Google and this threw up a couple of likely candidates: