Thursday 11 October 2012

SharePoint 2010 colour calendar


This is a slightly updated post for the colour calendar script which should work with the more items link and also with post-SP1 installations. I have slightly changed the process for doing this to try and minimise the issues people were having with URLs in the links.
1) Create a new calculated field on the calendar called CategoryTitle with the formula:-
= "|||" & [Category] & "|||" & [Title]

2) Set the Month View, Week View and Day View under Calendar the calendar view settings to all be your new CategoryTitle field.

3) Upload a text file containing the following content to a document library. In this case I have created pw.txt.
I know people have been having trouble copying this script so you can   download it Here

4) On the calendar page itself, edit the page and add a Content Editor Web Part. In the content editor web part settings, set the content link to the url of the newly uploaded text file, click the test link to ensure that the url is correct (i.e. it downloads the file)


5) Refresh the page and you should find the calendar is now coloured.
There are a couple of things to note here, for the JQuery link I have used Microsoft’s CDN link. This means that the page will load the JQuery library from Microsoft. Browser caching means it won’t do this for every page view but if you would prefer to use a locally held library instead (if you don’t have internet access for instance) then just change the script link in the script above. Any relatively recent version of JQuery should work fine.

No comments:

Post a Comment