Tuesday, May 17, 2011

SP2010 : Color coded Calendar

I have used color coded calendar in MOSS 2007 but using it in SP2010 was little tricky. Here's some of the things which can make you life easier.


1. Create or open a calendar with some data

2. Add a new column named "Color" of "Choice" type with some color choices. Color selection available

3. Add a new column named "CalendarText"
>>>> Column Type is Calculated
>>>> Insert Column Field value should be 'Color' (created in the step 2).
>>>> Data type returned = single line of text.
>>>> Formula is: ="<span style='color:white;background-color:"&Color&"'>"&Title&"</span>"

4. Modify the existing view, or create a new view of 'Calendar View' type.

5. Change the field used for the Month View Title, Day View Title and Week View Title to "CalendarText".

6. Save and exit (The HTML for "<span" will now be displayed.

Some JavaScript/Jquery will be needed to fix the HTML tags.

7. Download this text file

8. Download this DWP file

9. Save the text file in Shared Documents library. ( as of now this is hard-coded location ).If you uploading it to a different location , you will need to open DWP file and change text file location accordingly.

10. Navigate to the calendar view and edit page

11. Import the DWP webpart BELOW the calendar WP. You are all set now.


Anonymous,  January 10, 2013 at 3:56 AM  

How to remove html comes on mouse over?