4

I have a calendar list setup. My customer could like to give the appointments in the calendar view (by default green) a different color based on the category; much like the way Outlook does it. I found out that there are different CSS styles for the calender items, which are used when you use the overlay feature.

So I'm now looking for a way to link a certain category for an appointment to one of these CSS classes. I checked the html output, but it seems like custom fields like my category field aren't included in the output. I thought about using jQuery and a custom serverside service, but that's a lot of work and on top of that the ID isn't available in the HTML (okay, it's included in the hyperlink url, but that's ugly).

I couldn't think of options involving SPD or serverside trick, but perhaps someone here has got a good idea. Of course I know there are third party solutions; but since the ootb web part is 99% ok I'd rather not step out of the box when there's no need to.

1

2 Answers 2

1

An option if you have less than 10 categories: create one view per category, using filters. Then apply the overlay technique to regroup all the views in one calendar.

1
  • Simple but effective, works great; thanks.
    – Jasper
    Apr 28, 2011 at 13:10
3

You can look at Christophe's color coded calendar solution. Basically you have a calculated column generate some HTML and use his TexttoHTML script to force the browser to render it. It's really slick and works client side seamlessly.

5
  • Have you tested this with 2010? We had a similar solution and it does not work for 2010. For 2010 this works better : orbitone.com/en/blog/archive/2010/10/25/…
    – Shoban
    Apr 27, 2011 at 13:18
  • We're on 2007, but I have seen people post on other boards it works for them. They may have rewritten the calculated columns to the 2010 classes though. Apr 27, 2011 at 13:40
  • @Shoban: my solution also works on SP 2010 (see the instructions). The post on the orbitone site is good, but contains a couple errors. And Mike Smith's solution doesn't work for every configuration (for the record I have one that is similar to his but I never published it).
    – Christophe
    Apr 27, 2011 at 14:02
  • @EricAlexander your link is broken, am not able to get to see anything n the color coded solution. if you have the content, can you pls post it here,it would be helpful for the community.
    – dasarp
    Feb 20, 2017 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.