Supporters of End User
Web

7 Minute Screencast: Color code a SharePoint Calendar - Update

Item is currently unrated. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.
Categories:Screencast; MOSS; WSS; 2007; 2010; Color Coded Calendar; Calendar; Site Manager/Power User

In this screencast, Jim Bob Howard continues his examination of different techniques for color coding a SharePoint calendar. The techniques used here are of a more generic nature than the initial treatment.

7 Minute Screencast: Color Code a SharePoint Calendar - Update

Comments

Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Just to clarify... use this method if you don't have a common character in a unique location in your DateType choices.

Posted 27-Apr-2009 by Jim Bob Howard
Mick Brown

7 Minute Screencast: Color code a SharePoint Calendar – Update

Thats cool Jim Bob! I'd definitely use that, I think I would also add a CEWP at the top of the calendar view with the color code key so that peopel can refer to that as an instant reference. Nice screencast, thanks.

Posted 27-Apr-2009 by Mick Brown
Frank

7 Minute Screencast: Color code a SharePoint Calendar – Update

Great information but will this work in WSS 3.0? We hope to up-grade to MOSS sometime this year.

Posted 27-Apr-2009 by Frank
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Yes, it works with WSS. That's what we use.

Posted 27-Apr-2009 by Jim Bob Howard
EndUserSharePoint

7 Minute Screencast: Color code a SharePoint Calendar – Update

Frank,

For future reference, the solutions in all screencasts on this site can be implemented in WSS unless otherwise noted.

Mark

Posted 28-Apr-2009 by EndUserSharePoint
Christophe

7 Minute Screencast: Color code a SharePoint Calendar – Update

Jim Bob, have you checked out my formula generator? It should help a lot in the formula building process, even though some fine tuning will be necessary to replicate your example.
Here is the link:
http://www.pathtosharepoint.com/HTMLcc/default.aspx

Posted 28-Apr-2009 by Christophe
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Yes, Christophe, I like what you've done there. That can be a great starting point for creating the Color and BGColor columns. It would certainly help with first-timers creating nested IF statements.

Well done!

Posted 28-Apr-2009 by Jim Bob Howard
Fun with Colors: The Color-Coded Calendar | End User SharePoint

7 Minute Screencast: Color code a SharePoint Calendar – Update

[...] 7 Minute Screencast: Color code a SharePoint Calendar - Update [...]

Posted 30-Apr-2009 by Fun with Colors: The Color-Coded Calendar | End User SharePoint
Screencast: Color Code a SharePoint Calendar - The PayRoll Schedule | End User SharePoint

7 Minute Screencast: Color code a SharePoint Calendar – Update

[...] 7 Minute Screencast: Color code a SharePoint Calendar - Update [...]

Posted 30-Apr-2009 by Screencast: Color Code a SharePoint Calendar - The PayRoll Schedule | End User SharePoint
Christophe

7 Minute Screencast: Color code a SharePoint Calendar – Update

Jim Bob: the formula generator is not just for first-timers. This may surprise you, but actually most of the requests for help I receive are from people who simply forgot a quote or a parenthesis in the formula!

Posted 02-May-2009 by Christophe
Chris Swinney

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi Jim,

I'm relatively new to SharePoint but I've been looking at a way to colourised a SharePoint calendar for a while. Ideally, I would like to be able to combine this with the Team Master Calendar, arranged by Mark Miller.

What I would like to be able to do is allow user to connect their Outlook calendar to a team/individual calendar in SharePoint, then combine these into a team view and colour code entries based on their team designation.

I can see this being a lot of work, but wonder if there is a way to do this?

Cheers.

Posted 18-May-2009 by Chris Swinney
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

I have posted an updated solution for a color-coded calendar that uses a lookup list for DateTypes.

Posted 20-May-2009 by Jim Bob Howard
Kelly

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi, I have created my columns according to the 7 Minute Screencast: Color code a SharePoint Calendar - Update, everything is fine except, my display actually displays the CSS code with variables replaced. I cut the CSS out and put it in regular HTML and it works. Any ideas on what I am doing incorrectly?
This is what displays
PD
Here is the code
=""&Status&""

Posted 20-May-2009 by Kelly
Kelly

7 Minute Screencast: Color code a SharePoint Calendar – Update

Ok, so you cannot see the code, how do I send that to you?

Posted 20-May-2009 by Kelly
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Mark should be able to make it visible here.

But in the meantime, try posting it as a comment on my blog.

Posted 20-May-2009 by Jim Bob Howard
Kelly

7 Minute Screencast: Color code a SharePoint Calendar – Update

Jim Bob,
Here is how it looks (going to try making it visible with CSS comment)
Code I used
/* =""&Status&"" */
What was displayed
/* WFH */

Posted 20-May-2009 by Kelly
Color-coded SharePoint Calendar with Lookup DateTypes | End User SharePoint

7 Minute Screencast: Color code a SharePoint Calendar – Update

[...] my previous articles on color-coded calendars, the colors have been calculated based on a Choice field. But what if you need more functionality [...]

Posted 04-Jun-2009 by Color-coded SharePoint Calendar with Lookup DateTypes | End User SharePoint
Tim

7 Minute Screencast: Color code a SharePoint Calendar – Update

Thanks Jim Bob, this has been very useful. I never would have been able to figure out anything like this on my own. Your solution is working pretty good for me, with two exceptions I'm hoping you will be able to help me resolve. First understand I'm not a sharepoint admin, I'm only a a user creating a team site (But I have full control to that team site). The first problem I am having is that multiple day events are displaying correctly with the correct color, but single day events (Days with the same from and to date) show the code that is in the Display field rather than the banner. The second is that I lost the ability to click on the text in that banner box to bring that record up in display mode. Thanks in advance for any advice.

Posted 21-Jul-2009 by Tim
Stan

7 Minute Screencast: Color code a SharePoint Calendar – Update

Thank you for a very handy solution! I've set up a calendar on my site and have it running, but am experiencing an issue with the week view. It seems to work propoerly for multi-day events (as Tim reports), but single day events do not render with the selected colors and only show the start time. Any ideas as to why Week view would not work. Thanks again!

Posted 21-Jul-2009 by Stan
Tim

7 Minute Screencast: Color code a SharePoint Calendar – Update

An update to my earlier post yesterday...I found another posting indicating that I should replace the DIV with SPAN and that seemed to work a little better. It appears that most of issues revolve aroung the fact that I created my own start and end dates (Dates Only). What I have is a calendar that has multiple content types (On Call, Vacation, Holiday, etc.) I set my time intervals for the calendars to be the date fields I created, but on the display it never shows the end date i.e. If I had a start of 7/21 and end of 7/28 it shows on the calendar spanning 7/21-7/27. I'm assuming that this has to do with the fact that the end date field is 7/28 12:00am and not the 7/28 11:59pm I would want. I've created new hidden end date field that will add time to the user entered end date field so that I have a behind the scenes end date field of 7/28 11:59 pm but then the calendar function won't let me use that calculated date in its time interval. I'm lost as to what to try next.

Posted 22-Jul-2009 by Tim
Christophe

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi Tim,

that's right, I have recently replaced div tags with span tags in the calendar tutorial, to get cleaner html:
http://pathtosharepoint.wordpress.com/2008/11/15/sharepoint-calendars-color-coding-hover-effects-etc/

I also recommend that you check out this post, it lists known issues with SharePoint calendars:
http://pathtosharepoint.wordpress.com/2008/11/13/issues-with-calendars/
In particular you'll notice that SharePoint calendars don't like calculated dates.

Christophe

Posted 22-Jul-2009 by Christophe
Tim

7 Minute Screencast: Color code a SharePoint Calendar – Update

Thanks Christophe, I had read both of those posts and that's where I got the change from DIV to SPAN...Good stuff by the way, sure glad you guys take the time to post your expertise...My problem that I'm attempting to resolve is that events that are multi day show one day less on the month calendar (I.E. if a user says they are taking vacation monday 7/26 thru Wednesday 7/28 it's only showing the bar on 7/26 and 7/27). To further compound the issue on days that you have multiple events occurring (Both single day event and multi day events that span that date) and you click on the 1 day view, the multi day events display nicely but cover up the single day events which also have the stupid 12:00 AM information attached to them. Was just hoping that somebody had this issue and had resolved it. I'm personally not a developer and cannot read HTML or JAVA or anything, but I have looked at the source code for the calendar and it just seems to me that using the techniques you guys are using here that the ColSpan could be bumped up by 1(taking into account some nifty coding for multi row events), or the class for single day changed to muworkitem or width="100%" or whatever it would take to make it display correctly. Appreciate anyones advice and help on this.

Posted 23-Jul-2009 by Tim
Scott S

7 Minute Screencast: Color code a SharePoint Calendar – Update

I don't see that anyone has experienced this issue so I thought I'd ask. Everything works great for me, all views, my events color coded per department and clickable. But on all the scheduled events I'm seeing the calendar's default color and border around my events. How do you turn off that defaults to let only the custom ones show?

Posted 27-Jul-2009 by Scott S
Frank

7 Minute Screencast: Color code a SharePoint Calendar – Update

Can someone PLEASE HELP? For the life of me I cannot get the colors to work for me. I would like to use the green, yellow, blue and red. I learn better with visual aids. Can someone can send me screen shots of the ‘step-by-step’ process. You can contact me at frank.morales@amedd.army.mil
Thanks

Posted 27-Jul-2009 by Frank
Fey

7 Minute Screencast: Color code a SharePoint Calendar – Update

I have found this to be very helpful but there is apparently a limit to the number of different colors you can enter. It looks like the limit is 7. We need 10.

Is there a work-around for this?
Thanks

Posted 29-Jul-2009 by Fey
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Sure, Fey, look at:

Color-coded SharePoint Calendar with Lookup DateTypes
http://www.endusersharepoint.com/?p=1721

There shouldn't be a limit there. The 7-color limit you mention is due to the limit on the number of nested IF statements SP allows, with the Lookup DateTypes approach doesn't use.

Hope that helps.

Blessings,
Jim Bob

Posted 30-Jul-2009 by Jim Bob Howard
Lynley

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi, everyone,

My apologies if this is addressed in the screencast (unfortunately, it's blocked by our network), but I've been able to successfully color code my calendar based on a Category field within the calendar. Love the formula generator, Christophe - thanks! However, I actually need to color code my calendar by content type (and for one instance, by a particular field within a content type). I'm not a programmer by any means, so I'm unsure how I would adapt the basic principles to point to different content types instead of a single column. Is this doable OOTB, or would I need to use SharePoint Designer?

Thanks as always!

Posted 13-Aug-2009 by Lynley
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Content Type is one of the columns in your data. When using a calculation column for your colors, simply include Content Type in the mix.

Blessings,
Jim Bob

Posted 13-Aug-2009 by Jim Bob Howard
Lynley

7 Minute Screencast: Color code a SharePoint Calendar – Update

Thanks, Jim Bob! As soon as I'd posted the question, I realized that content type was an option! However, now I'm running into a problem with the view of the calendar itself - the calendar needs to display the Trainers field, which is a "Person or Group" field that's pulling from a SharePoint group. The field was set up so that multiple trainers could be assigned to an event (and the managers need to see in the calendar view that multiple trainers are assigned, so having a separate field for a second trainer may not be an option). However, when I try to update the code to pull from the Trainers field, it's not listed as an available column in the calculated column setup, and I get an error if I try to type it in manually (the error message says, "One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas." Do you know of a way around this snag or an alternate way I could set up the columns/content types?

I can't thank you enough for your help!

Posted 13-Aug-2009 by Lynley
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Sure, Lynley. You're going go into SharePoint Designer 2007 and create a workflow that can populate the field the way you need it.

If you need some help with that, please post it to Stump the Panel, so that others will be able to find it easier. ;)

Blessings,
Jim Bob

Posted 13-Aug-2009 by Jim Bob Howard
Lynley

7 Minute Screencast: Color code a SharePoint Calendar – Update

I figured Designer would probably be the answer ;0) I actually posted to STP right after I posted here the first time - I'll give it a shot, and if I need additional help, I'll post there.

Thank you so much!

Posted 13-Aug-2009 by Lynley
Mas

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi Jim,
I successfully created the color coded calendar, but for given days I am getting "more items", when I expanded monthly calendar, calendar did not display those items and still saying that "more item" for that given day, what could be reason.
Could you please help.

Thanks
Mas

Posted 18-Aug-2009 by Mas
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Mas,

I haven't seen that problem. Perhaps Christophe could answer that. How many items do you have per day on those with the "more items" link?

Blessings,
Jim Bob

Posted 18-Aug-2009 by Jim Bob Howard
Mas

7 Minute Screencast: Color code a SharePoint Calendar – Update

I tried to use standard list calendar as well as Event calendar and for some month even items are not more than 100.

Thanks for help.
Masood

Posted 18-Aug-2009 by Mas
Hi Jim

7 Minute Screencast: Color code a SharePoint Calendar – Update

I applied this method to our existing training calendar. It worked, but in a limited way. It allows only 8 DataType (9 is reserved for "everything else"). Are you aware of that? We certainly have more than 8 types of training. What's your suggestion for a solution? Secondary, this color coded calendar shows only the "Display" calculated field, instead of "Title", any event the user does not select from the predefined DataType (TrainingLabel in our case)list will be blank, that's not good, we want some text there. Besides, one Traininglabel could have more than one variation to describe the location and/or group #, "Display" field won't reflect that detail. What part of script should I change to have the color coded calandar display the Title field rather than the Display field?

Thanks!

Posted 14-Sep-2009 by Hi Jim
Hi Jim

7 Minute Screencast: Color code a SharePoint Calendar – Update

Jim, here I am again. Sorry for the first question, I should have read the thread before I post. So you are aware of it and had a solution already. It can't work for me though, as I do not have SharePoint Designer. So I am stuck with 7-number limit or 8-number limit?

Posted 14-Sep-2009 by Hi Jim
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Yong Hui,

What may work for you is to combine a couple of display fields. (Oh, and the reason for the Display field is to build the HTML needed to show the colors. You can include the Title in that calculated field if you choose.)

Nested IF Statements
To combine fields, you may have to create multiple "Color" fields:

Color1 : =IF(Type=A,red,IF(Type=B,blue, ... IF(Type=H,green,""))))))))

Color2 : =IF(Type=I,yellow,IF(Type=J,orange, ... IF(Type=P,purple,""))))))))

...

If you do it this way, you could conceivably include 65 colors (8 x 8 + 1 default), by creating a FinalColor...

FinalColor : =IF(Color1!="",Color1,IF(Color2!="",Color2, ... IF(Color8!="",Color8,DefaultColor))))))))

CHOICE Statement
Another option would be to assign a number to each Training Type in the same way.

Color1 : =IF(Type=A,1,IF(Type=B,2, ... IF(Type=H,8,0))))))))

Color2 : =IF(Type=I,9,IF(Type=J,10, ... IF(Type=P,16,0))))))))

...

ColorChoice : =Color1+Color2+Color3+...+ColorN

Then you could use a CHOICE statement like this:

FinalColor : =IF(ColorChoice=0,DefaultColor,CHOICE(ColorChoice,red,blue,yellow,green,orange,purple,chartreuse, ... fuschia))

Let me know if that helps.

Blessings,
Jim Bob

Posted 15-Sep-2009 by Jim Bob Howard
Cherry

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi Jim Bob

Your site has been very helpful with the calendar function. I've been using if for time off request.
I currently have different color for each department and using workflow.

I was wondering if you can help me figure out how to make the calendar color red when someone takes the same time off. Bascially I want to quickly be able to see if there's a risk if someone is out the same day or around the same time.

Posted 16-Sep-2009 by Cherry
Hi Jim

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi Jim,

Thank you for taking the time to help out, sorry for my delay.

I created another calendar to try out your method. The new fields finally all passed the syntax. It turned out SharePoint does not take color names, only hex numbers are acceptable. Nor does it like color1! etc. So I used your second option. What I got eventually is #Value displayed throughout my calendar, with no colors. I believe I am very close, just couldn't figure out where I had it wrong. I have:

Label (for drop down choices)
Color1 (the rest are calculated)
Color2
ColorChoice
FinalColor
Display
BGColor1
BGColor2
FinalBGColor


Jim, I know you are very busy. If you think you can still help, I can email you the formular scripts. Thanks a bunch anyway!

Posted 24-Sep-2009 by Hi Jim
Hi Jim

7 Minute Screencast: Color code a SharePoint Calendar – Update

Please disregard my prior posting. I had it working!! It is exciting I have endless choices to color my calendar. Jim, you are great, so very helpful.

Yonghui

Posted 24-Sep-2009 by Hi Jim
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Good job, Yong Hui! That was fast! I was just emailing you to ask you to send your calculated columns.

Glad you got it working!

Posted 24-Sep-2009 by Jim Bob Howard
John

7 Minute Screencast: Color code a SharePoint Calendar – Update

Does anyone know how to achieve this in 2003. Problem is calendars only display the Title field

Posted 06-Oct-2009 by John
Leo

7 Minute Screencast: Color code a SharePoint Calendar – Update

Mas,

Have you found a solution? We're having the same problem.

Items won't show on the month view for 11/12 but do show on the day/week view.

- Leo

Posted 26-Oct-2009 by Leo
Christophe

7 Minute Screencast: Color code a SharePoint Calendar – Update

Leo, see my earlier comment (21). Follow the links to get a list of SharePoint calendar issues and some workarounds (see in particular the Microsoft links).

Posted 27-Oct-2009 by Christophe
Jessica

7 Minute Screencast: Color code a SharePoint Calendar – Update

I have tried this way and I have tried Christophe's way. Neither way is giving me results. Can someone please help? I just keep getting the default colors.

Posted 16-Nov-2009 by Jessica
Ryan

7 Minute Screencast: Color code a SharePoint Calendar – Update

I have attempted to implement the solution mentioned above and when I modify the view to show the display i see "[Activity Type]" across the calendar where users have created calendar events. I have used Activity Type in place of date type mentioned in the above screen cast. Thank you in advance for your assistance.

Posted 19-Nov-2009 by Ryan
Angela

7 Minute Screencast: Color code a SharePoint Calendar – Update

I'm having trouble creating the Date Choice column. When I create it, it doesn't have a place to insert the formula. Does anyone know what I'm doing wrong?

Posted 19-Nov-2009 by Angela
Sandy

7 Minute Screencast: Color code a SharePoint Calendar – Update

Text for content editor webpart link to Christophers site does not provide WHAT to put in it. HELP! I re-built and now just need the CEWP info.

Posted 03-Feb-2010 by Sandy
EndUserSharePoint

7 Minute Screencast: Color code a SharePoint Calendar – Update

Sandy - Go to Christophe's forums on Stump the Panel. He checks in daily. -- Mark

Posted 03-Feb-2010 by EndUserSharePoint
Herb

7 Minute Screencast: Color code a SharePoint Calendar – Update

I have implemented all the steps for my color coded calendar - but the colors do not display. Everything in my calculated columns passed syntax.

Here is the syntax used:

DayChoice: =IF(CircDayType="Regular Full Run",1,IF(CircDayType="Bonus Day",2,IF(CircDayType="Exception Day",3,4)))

Color: =CHOOSE(DayChoice,"#008000","#800000","#800080","#008080")

BGColor: =CHOOSE(DayChoice,"#ccffcc","#ffccff","#cccccff","#ccffff")

Posted 09-Feb-2010 by Herb
EndUserSharePoint

7 Minute Screencast: Color code a SharePoint Calendar – Update

Post this to Christophe's forum on Stump the Panel and you'll get a quicker, and more complete, response.

Posted 09-Feb-2010 by EndUserSharePoint
Greg

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hey Jim,
Nice screencast..very helpful. Trying to apply this concept to a Change Calendar where Impact Type is color coded. Having an issue with the colors appearing. Did everything like in your screen cast. If I open up a calendar item, the Display shows correctly. If I copy and paste the code that was compiled in a calendar entry into an htm, it seems to open and display correctly in a browser. So not sure why the colors aren't coming through in my calendar views. I have put together some screenshots to show what I've done with the List columns. I can send to someone that is willing to help. Any help is appreciated!

Posted 12-Feb-2010 by Greg
April

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hello,

Is there a formula to put into a calculated field following the same concept but instead of spitting out a color, spitting out the text with strikethrough applied??

Please help if so!!

Posted 15-Apr-2010 by April
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

Sure. You could use style="text-decoration: line-through;" or create a class that did the same thing.

http://ilovethecode.com/How_Tos/How_Tos-Programming-Tips/CSS_Strikethrough.shtml

Blessings,
Jim Bob

Posted 16-Apr-2010 by Jim Bob Howard
Paul

7 Minute Screencast: Color code a SharePoint Calendar – Update

Hi Jim,

Great job! This tutorial is very helpful
I have just a question, when I follow the steps and a give color to my Sharepoint calendar I am not able to see the "Title" on the events, I only see the "DateType".

Is there any modification that can be done in order to see the event title and colors as well?

Thank you very much!


Paul

Posted 22-Apr-2010 by Paul
James Petrey

7 Minute Screencast: Color code a SharePoint Calendar – Update

We are trying out SharePoint through Rackspace can we use color coding with their Windows Sharepoint Services 3.0.?
We would like to use something similar to the Label field in Outlook

Thank you

Posted 06-Aug-2010 by James Petrey
Jim Bob Howard

7 Minute Screencast: Color code a SharePoint Calendar – Update

James,

I did the screencast using WSS 3.0, so I would assume that would be an option for you through Rackspace.

Blessings,
Jim Bob

Posted 06-Aug-2010 by Jim Bob Howard
Larry W. Virden

Trying to determine why I am getting a syntax error

The following is what I typed into a calculated column. I tried to base it off this screen cast.
----
="<DIV style='border: 1px "
&COLOR&
" solid; padding: 5px; margin: 0px; color: "
&COLOR&
"; background-color: "
&BGCOLOR&
";'>"
&Content Type&
"</DIV>"
----
When I try to save this formula, SharePoint 2007 SP1 says
 
The formula contains a syntax error or is not supported. 
 
It looks to me like

Posted 14-Feb-2012 by Larry W. Virden
Larry W. Virden

finish my comment

(whoops! missed the end of my comment)
It looks to me like for some reason, the calculated column doesn't like me putting text outside of the quotes - if I use
="<DIV style='": 1px"
[COLOR]
that fails as well.
But if I don't have the variable outside of the quotes, then it takes the info.

Posted 14-Feb-2012 by Larry W. Virden
Larry W. Virden

Displaying info

Well, when I used this as my calculated column
="<DIV style='border: 1px
[COLOR] solid; padding: 5px; margin: 0px; color: [COLOR]; background-color: [BGCOLOR];>[Choice]</DIV>"
 
SharePoint 2007 accepted it - but what it did was display the results as:
<DIV style='border: 1px
[COLOR] solid; padding: 5px; margin: 0px; color: [COLOR]; background-color: [BGCOLOR];>[Choice]</DIV>   testing 
 stuff 2/14/2012 8:00 AM 2/14/2012 8:00 AM
 
instead of rendering the HTML.  Is there something else that I need to do to get SharePoint to render this html? I have seen other solutions where people had to add a web part and some javascript to convert the text that looks like html into html...

Posted 14-Feb-2012 by Larry W. Virden
Larry W. Virden

Displaying info

Well, when I used this as my calculated column
="<DIV style='border: 1px
[COLOR] solid; padding: 5px; margin: 0px; color: [COLOR]; background-color: [BGCOLOR];>[Choice]</DIV>"
 
SharePoint 2007 accepted it - but what it did was display the results as:
<DIV style='border: 1px
[COLOR] solid; padding: 5px; margin: 0px; color: [COLOR]; background-color: [BGCOLOR];>[Choice]</DIV>   testing 
 stuff 2/14/2012 8:00 AM 2/14/2012 8:00 AM
 
instead of rendering the HTML.  Is there something else that I need to do to get SharePoint to render this html? I have seen other solutions where people had to add a web part and some javascript to convert the text that looks like html into html...

Posted 14-Feb-2012 by Larry W. Virden
Larry W. Virden

Okay, figured out my problem

The problem was that I was missing spaces in the formula, and sharepoint was being cranky.  Once I used the proper quoting and spaces, then things worked as I had wanted. Now to try and find the URL for the text that goes into the CEWP

Posted 14-Feb-2012 by Larry W. Virden
Sean Corro

Content Editor Webpart

Hi Jim
Thanks so much for the video,
I'm having one issue though i tried to add in the code for the source editor but the colours are not showing instead it still stays as the HTML tags eg. <DIV>...blahblah. Here is what i used for the source editor:
 
<script type="text/javascript">
var theAs = document.getElementsByTagName("a");
var i=0;
var AContent = "";
while (i < theAs.length)
{
try
{
AContent = theAs[i].innerText || theAs[i].textContent;
if ((AContent.indexOf("<DIV") >= 0) && (AContent.indexOf("</DIV>") >= 0)) {
var tempDIV = document.createElement ("DIV");
tempDIV.style.cursor = "pointer";
tempDIV.innerHTML = AContent;
theas[i].innerHTML = "";
theas[i].appendChild(tempDIV);
}
}
catch(err){}
i=i+1;
}
</script>

is there something wrong? and i also did put the content editor below the calendar.

Posted 28-May-2012 by Sean Corro
Jim

Choice syntax

Jim Bob,
 
I tried to implement the FinalColor option to have more than 9 color options, but the FinalColor calculated field formula appears to have an issue with the CHOICE keyword. Then again, this may not be a keyword and I may not be understanding how to make this solution work. Any help is greatly appreciated.
 
Thanks
BTW - I am using WSS 3.0

Posted 04-Sep-2012 by Jim

Notify me of comments to this article

E-mail:
   

Add Comment

Title:

 
Comment:
Email:

   


Name:

 
Url: