7/22/2010

CSS Resources

 

Just a few CSS resources for my classes:

7/19/2010

SharePoint: Font Sizes!

 

Simple question… I want to update core.css to change the font sizes displayed in the page… how many do I need to update?

Would believe 19 different font sizes in 155 different styles in MOSS? 

And in SharePoint Server 2010 there are 36 different font sizes in 222 different styles!

 

Out of the table below, there are a few that really make you go “huh?”

  • font-size:1pt;    (I need better glasses)
  • font-size:72pt;  (I can see that one! Ok, not fair, this one is not used in a page, but is an optional size in the rich text editor…)
  • font-size:0px;  and 1px and 2px???

After seeing all of those fixed font sizes you now understand why your browser’s “View, Text Size” feature does nothing to SharePoint pages.  Good thing IE 7 and FireFox added a Zoom option! 

 

To explore your core.css file just modify your SharePoint site’s URL to look like this:

     http://yourservername/sites/yoursitename/_layouts/1033/styles/core.css

 

Or if you have access to the server open up Windows Explorer and go here:

2007: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\STYLES

2010: C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\1033\STYLES

(The 1033 is for English)

 

 

Font sizes found in CORE.css:

 

MOSS 2007 Count SharePoint Server 2010 Count
         
font-size:1pt; 3   font-size:1pt; 3
font-size:7pt; 2   font-size:7pt; 2
font-size:8pt; 115   font-size:8pt; 127
font-size:9pt; 4   font-size:9pt; 4
font-size:10pt; 4   font-size:10pt; 6
font-size:11pt; 1   font-size:11pt; 3
font-size:12pt; 2   font-size:12pt; 4
      font-size:14pt; 1
font-size:16pt; 3   font-size:16pt; 6
      font-size:18pt; 1
      font-size:24pt; 1
      font-size:36pt; 1
      font-size:48pt; 1
      font-size:72pt; 1
         
      font-size:0px; 2
font-size:1px; 1      
font-size:2px; 6   font-size:2px; 7
font-size:10px; 1   font-size:10px; 1
      font-size:14px; 1
         
      font-size:.6em; 1
      font-size:.68em; 4
      font-size:0.7em; 3
      font-size:.7em; 5
      font-size:.85em; 1
font-size:1em; 4   font-size:1em; 11
      font-size:1.0em; 7
      font-size:1.1em; 1
font-size:1.2em; 2   font-size:1.2em; 3
      font-size:1.3em; 4
      font-size:2em; 2
      font-size:2.2em; 1
         
         
font-size:65%; 1   font-size:65%; 1
font-size:80% 1   font-size:80% 1
font-size:100%; 2   font-size:100%; 2
font-size:120%; 1   font-size:120%; 1
font-size:150%; 1   font-size:150%; 1
font-size:200%; 1   font-size:200%; 1
         
Count of sizes 19 Count of sizes 36
Total occurrences 155 Total occurrences 222

 

 

.

7/15/2010

Live Chats to Learn more about SharePoint - with the MVP Experts

 

Do you have questions about SharePoint? Want to learn more about the recently launched SharePoint 2010?  By popular request, SharePoint MVPs from around the world are participating in a live chat event about SharePoint. These Q&A events are a great opportunity to tap into the vast knowledge of these industry professionals who are regarded as the best in their field.

Please join us on Wednesday July 21st at 9am PDT (12 Noon “Cincinnati time”) to chat with MVPs from around the world.

Learn more and add these chats to your calendar by visiting the MSDN event page http://msdn.microsoft.com/en-us/chats/default.aspx

 

.

7/09/2010

SharePoint 2010: Replacing the Crumb Trail and Changing the Title

 

I like SharePoint 2010, I really do… but I just can’t get the hang of the Site Title / Crumb Trail thing, and the Navigate Up button is just not right. Below is a series of screens to show how the 2010 navigation works, and the issues I have with the interface. There’s no point in just complaining, so I also have one possible “fix” at the end of this article.

Please leave some comments:

  • Am I not understanding how the crumb trail should work?
  • Do you have a better solution?

I know that I’m not done with this… so check back…  (See here for more about the CSS to change the site title area.)

 

 

My Issues with the Site Title / Crumb Trail

 

The Home Page of the site

image

Issues:

  • The Site Title is small and not resizable. We had that issue in 2007 also, but we could fix it will a simple CSS addition. Here the title is part of the crumb trail.
  • Can you even tell if this site is a subsite of another site? (other than I named it #2)  You can click the Navigate Up button to find out:
    image
  • The “Home” text is almost ok, but I can’t edit this. (easily anyway)

 

In a document library:

image

 

Issues:

  • No room for long titles, especially with lists with long names
    image
  • The View dropdown menu is now in the crumb trail! Any redesign/branding we do may lose the view menu!
    image
  • When you dig into the CSS for this area, there is no clean way to set a new font, color or size. I’ll show how in another article (here), but it’s not as easy as it was in 2007.

 

In the library’s Security Documents folder:

image

 

Issues:

  • If I was happy with the issues already listed, then this screen is OK, but drill down another folder…

 

In a sub folder of Security Documents:

image

 

Issues:

  • When you get down to a sub-folder the crumb trail fails. There is no one-click way up to the parent folder. Your only option is to use Navigate Up (two clicks), or go to the top of the library and drill back down.
     
    The Navigate Up dropdown:
    image

 

 

A Possible Solution

 

Below is the result I want… a big title, and a working crumb trail with all of the folders.

 

Home page:

image

 

In a library with nested folders:

image

 

How to get there?

  • Hide the existing crumb trail, but leave the Site Title
  • Restyle the Site Title (color, font, size, etc)
  • Add the SharePoint 2007 crumb trail control
  • Copy the part of the hidden crumb trail’s HTML that displays the View dropdown to just after the 2007 crumb trail
  • Restyle the View dropdown to match the 2007 crumb trail

Steps:

  1. Open SharePoint Designer 2010, open your site and open the v4.master master page for editing
     
  2. Hide the existing crumb trial:
    1. Search for “PlaceHolderPageTitleInTitleArea” and add a DIV block around the two lines before and one line after this text: 

      image
      This will hide the existing crumb trail, but also hides the View dropdown which we will need later.
       
    2. Restyle the Site Title
      At the end of the page, just before the </BODY> tag add a <STYLE> block something like this: (new code in bold)
       

        <style type="text/css">
          .s4-titletext h1 a
          {
            color:Blue;
            font-size:24pt;
          }
        </style>

        </body>

    3. Add the SharePoint 2007 crumb trail control and a DIV for the View dropdown – I put it just before “PlaceHolderMain” to be near where it was in 2007:  (new code in bold)
       
      <a name="mainContent"></a>
       
        <div>
           <br/>               
           &nbsp;<asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap2" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>&nbsp;
          <span id="myViewDiv"></span>
           <br/>
      </div>
       

      <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
      </asp:ContentPlaceHolder>
       

    4. We hid the old crumb trail, but we need the HTML that displays the View dropdown menu. The code here moves that HTML to our crumb trail:
       

      <script type="text/javascript">
        var OldCrumbTrail = document.getElementById("ctl00_PlaceHolderPageTitleInTitleArea_ctl01_ctl00");
        var NewCrumbTrail = document.getElementById("myViewDiv");
        OldCrumbTrail.childNodes[0].innerHTML=">";
        NewCrumbTrail.outerHTML = OldCrumbTrail.outerHTML;
        OldCrumbTrail.innerHTML = "";
        OldCrumbTrail.id="NOT_ctl00_PlaceHolderPageTitleInTitleArea_ctl01_ctl00";
      </script>

    5. Restyle the View dropdown to match the 2007 crumb trail – just add the following to the style block we created before:
       
      <style type="text/css">
        .s4-titletext h1 a
        {
          color:Blue;
          font-size:24pt;
        } 

        #zz17_ListTitleViewSelectorMenu
        {
            font-size:8pt;
        }
      </style>
       

 

.

 

 

         

7/08/2010

SharePoint 2010: Where are the Icons?

 

This article might be titled… Fun with SharePoint 2010 branding. I was trying to find the icon used as the divider in the SharePoint 2010 Site Title / Crumb Trail. It’s the little triangle below:

image

 

SharePoint 2010 Icons

So I was browsing the source HTML looking for the icon and ran across this image tag:

<img src="/_layouts/images/fgimg.png" alt=":" style="border-width:0px;position:absolute;left:-0px !important;top:-585px !important;" />

So my image must be fgimg.png, but it was not just he “image” symbol I was looking for. Scroll down to the end of this page to see the image and you will find that it’s not a single image, but collection of images in a single file. The image I was looking for was 585 pixels down in the file!

Actually, this is a kind of  cool trick. On the first reference the single file is downloaded and cached. When the next icon is needed, it’s already in the browser’s cache.

So how you get a single icon from the file? Based on how SharePoint does it, there are two parts:

  1. In the IMG tag set a negative number for the “top” style to skip the first set of icons:
       “top:-585px !important;”
  2. Wrap the image in a SPAN and crop out just the part you want by setting a height and width:
       “<span style="height:11px;width:11px;”
<span style="height:11px;width:11px;position:relative;display:inline-block;overflow:hidden;"><img src="/_layouts/images/fgimg.png" alt=":" style="border-width:0px;position:absolute;left:-0px !important;top:-585px !important;" /></span>

So, they build a box 11px by 11px and displayed fgimg.png in it, but offset by 585 pixels.

 

Sprites?

The correct term for these kinds of files are CSS Sprites.

Here’s two nice articles on CSS Sprites, and the second one has a huge number of examples:

http://www.thewebsqueeze.com/web-design-articles/an-introduction-to-css-sprites.html

http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/

 

SharePoint Sprites

Here’s a few of the sprite files I’ve found:

image

These can all be found in:

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES

Or from you browser:

    http://yourserver/sites/yoursite/_layouts/images/filename.png

 

How do you build your own sprite files?

By hand of course! (why not?)  Or, do a little web searching and you can find tools to build them for you.

 

fgimg.png

Sample SharePoint sprite: (the black background is the “transparent color” that is ignored when image is displayed.

image

 

.

7/06/2010

SharePoint: A Better People and Groups View

 

Customize the SharePoint People Views

SharePoint All People and Group views are a bit light weight. If you want to know someone’s phone number you have to click their name and wait for another page to load, or to see if they are a Site Collection Administrator you have to visit another screen. Normally we would just click the View dropdown and click Modify View or Create View, but the View menu here only has:

   image

Won’t it be nice if you could add more columns, or even group, sort or filter the list of users???

 

Fields Available

Turns out you can create your own views of People and you have 35 fields to choose from including both SharePoint and user profile data: (Items in the default views are in bold)

 

About me
Account
Attachment
Content Type
Content Type
Create
Created By
Deleted
Department
Edit (Edit)
Edit (link to edit item)
First name

ID
Is Site Admin
Last name
Modified
Modified By
Name
Name (linked to item with edit menu)
Name (linked to item)
Name (with picture and details)
Name (with picture)
Name (with presence)
Office

Picture
Responsibilities
Selection Checkbox (checkboxes) 
SIP Address
Title
Type (icon linked to document)
User name
Version
Web site
Work e-mail
Work phone

 

SharePoint 2010 adds: Mobile Phone

 

 

This is the default “Details” view:

 

image

 

To customize people views:

  • Go to the top level site in the site collection (important!)
  • Go to People and Groups (or Site Actions, Site Permissions in 2010) and click on any group, including All People (they all share the same views)
  • Go to Settings, List Settings and scroll down to the Views section.

image

  • Click Create View (Rather than changing the exiting views you probably should create a new view)
  • Select your view options like any other view
  • Optional: set sort, group, filter and other View options
  • Save the changes
  • Note: This will leave you in the new view, but the View dropdown will not be displayed, return to People and Groups (or Site Actions, Site Permissions in 2010)  and the view will be displayed correctly

 

 

Here is a customized view:

 

image

 

And the View dropdown now has your new view:

image

 

Here’s a SharePoint 2010 example with grouping by department:

image

 

Enjoy!

 

.

6/28/2010

SharePoint 2010: Color Coded Calendars!

An expanded version of this article, along with many other customization examples and how-tos can be found in my book, SharePoint 2007 and 2010 Customization for the Site Owner.

 

 

Updated 9/6/11

Service Pack 1 broke my color coded calendar code! For details see here. The code below has been updated to work with both the pre-SP 1 and SP 1 installations.

 

Updated 2/20/11

As I’m working on my customization book I am revisiting every one of my past “quick tips”. As I do so I am often finding a better way to do something. I ran into some issues working around the asynchronous loading of calendar events with the article below. After digging more into the code behind the calendar pages in 2010 I have found a much better way to trigger the color coding code.  The sections that have been replaced below are now crossed out (aaaaaa) and the new content added.

This update also solves most of the issues found in the comments at the end of this article, especially the “more items” problem.

 

 

Color Coded Events in SharePoint 2010 Calendars

Back in 2008 I wrote a little blog article on adding color to SharePoint 2007 calendar events. Several people have been pestering me to update it for SharePoint 2010, so here goes...

Several things have changed between SharePoint 2007 and 2010 to prevent the old example from working. For fellow “SharePoint client side hackers” I thought I would document the trail I followed to get color coding to work in 2010. For those who do not care about the details, just scroll on down to “Color Coded Events in SharePoint 2010 Calendars Step by Step”.

They broke the Content Editor Web Part!

In 2010 it’s now just called “Content Editor” and is in the “Media and Content” section of Add a Webpart:

image

 

When you add this web part you get a “wiki style” editor. Just click in the new web part and start typing. The Ribbon will then be updated to show all of the Rich Text editor options.

image

 

How do you add HTML?

You can just click the HTML button in the Ribbon (image ). But read on for some fun issues with this option…

image

But when you add CSS or JavaScript you may get this nice little message!

image

As a trivial example I entered:

  <style>
    .s4-titletext h1 a
    {
      color:red
    }
  </style>

and it reformatted it as:

  <style>

    .s4-titletext h1 a
    {
      color:red
    }</style>

and each time you go back into the HTML editor and click OK and adds another blank line after <STYLE>

  <style>

    .s4-titletext h1 a
    {
      color:red
    }</style>

It has even changed capitalization. In one of my edits it changed color:red  to  COLOR:red.

Who knows why….

 

So add your code directly to the page

Use SharePoint Designer and add the code to the bottom of the view page. The best place is most likely  between the “</WebPartPages:WebPartZone>” tag and the “</asp:Content>” tag. If you are using SharePoint Designer 2010 you will need to click “Advanced Mode” in the ribbon to edit that area.

 

Or just link to your code!

Both 2007 and 2010 offer the option to link from the CEWP to a text file with our content. So for 2010 I usually upload a text file containing the code to a library. Then in the CEWP just click the “Edit Web Part” option in the dropdown and add the link to the code file.

image

 

 

They broke the Calendar!

Not really, but is sure has changed. In 2007 the calendar was created entirely server side. The HTML sent to the browser was the final, ready to display HTML. All we needed to do was to write a little JavaScript and/or CSS to “customize” it.

Why it’s now a bit harder to code…

In 2010 the data for the calendar is now asynchronously loaded using a JavaScript function call after the page is loaded. That means that the data we want to change is not yet in the browser when our JavaScript is loaded from a Content Editor Web Part. If you have played with SharePoint client side JavaScript then you have seen the following command used to run a function after the page has loaded.

_spBodyOnLoadFunctionNames.push("_spAjaxOnLoadWaitWPQ2")

Note: _spBodyOnLoadFunctionNames is just a JavaScript array and push is a JavaScript method to add a new item to the end of the array. When a SharePoint page is loaded each function listed in this array is called in order.

I have used this often in 2007 to make sure the page is fully loaded before my JavaScript runs. The problem is where Microsoft loaded this for calendars in 2010… at the very end of the page. That means that when I use a Content Editor Web Part to add my JavaScript it will be in the “queue” before the JavaScript used to add the calendar events. So my challenge now is to get my code to run after the code that loads the calendar.

The work around?

The work around? We have to get our function added to _spBodyOnLoadFunctionNames after SharePoint's calendar update function. One way is to add our JavaScript in the master page and write the code so it only impacts calendars. But that’s a bad workaround. We would then have JavaScript that’s only needed for calendars added to every page.

So here’s another workaround… (Have a better idea? Let me know!)  Add a bit of JavaScript at the bottom of the master page that checks for an array of my functions that need to be run. If there’s no array, then do nothing…

  <script type="text/javascript">
    if (window.mikesCode)
    {
      for (var i=0;i<mikesCode.length;i++)
      { 
        _spBodyOnLoadFunctionNames.push(mikesCode[i]);
      }
    }
  </script>

Then in the Content Editor Web Parts (or anywhere else) add a custom function and add it to my little array.

  function DoSomethingCool()

  {

    // code here

  }

  if (!window.mikesCode)
  {
    mikesCode=new Array();  // create mikesCode if it does not exist
  }
  mikesCode[mikesCode.length] = "DoSomethingCool";   //add the function to run

 

Now we have all of the pieces…  (but I’m not finished with this article… I want to find a way to do this without the master page edit)

 

The new “work around!”

To get our code to run at the right time we need to hook into the SharePoint code that loads the calendar items. Once such place is a function named "SP.UI.ApplicationPages.CalendarNotify.$4a".We also need to delay the load of our code, and we can do that with a SharePoint feature named "_spBodyOnLoadFunctionNames.push".

As a result of this change I can now eliminate the need for the master page edit. (That trick is still useful for other kinds of customizations.)

 

 

Color Coded Events in SharePoint 2010 Calendars Step by Step

 

Add a little piece of code to the master page

  1. Open SharePoint Designer 2010 and open your site
     
  2. In the Navigation pane and in the Site Object section click Master Pages
     
  3. Click your master page (most likely “v4.master”) and if asked, check it out
     
  4. In Customization section click “Edit file”
     
  5. Scroll to the bottom of the file and just before the </body> tag add the script below
     
  6. Save the file and then check it in

<script type="text/javascript">
  if (window.mikesCode)
  {
    for (var i=0;i<mikesCode.length;i++)
    {
      _spBodyOnLoadFunctionNames.push(mikesCode[i]);
    }
  }
</script>

 

Setup the Calendar

The steps here are identical to the SP 2007 article.

  1. Create or open a calendar
     
  2. Add a new column named "Color" – most likely type will be "Choice" with choices like "Red, Green, Blue, Black", but this could be a lookup or a single line of text.
    (See here for an HTML color chart: http://www.w3schools.com/html/html_colornames.asp)
     
  3. Add a new column named "CalendarText"
    1. Column Type is Calculated
    2. Equation is:
          ="<font color='" & Color & "'>" & Title & "</font>"
      image
    3. Data type returned = single line of text
       
  4. Modify the existing view, or create a new view such as "Color Calendar"
     
  5. Change the field used for the Month View Title AND Day View Title AND Week View Title to "CalendarText"
    image
     
  6. Save and exit (The HTML for "<FONT" will now be displayed. Some JavaScript will be needed to fix the HTML tags)

Create the JavaScript file

Two Solutions!

1) Add a Content Editor Web Part as we have done in many of the other customizations. The problem with this approach is that SharePoint 2010 will no longer treat this page as a view. When this page is displayed you will see two changes:

· The View dropdown list in the site title area is missing

· The Ribbon will not be displayed when the page is first loaded, but will be displayed when any event item is clicked.

2) Add the custom JavaScript using SharePoint Designer. The page will then display as an ordinary view no odd behavior.

I recommend #2.

 

Option #1: Using the Content Editor Web Part

I usually add a library named Scripts, ScriptFiles or similar for these kinds of files. The steps below will just use the Shared Documents library.

  1. Open Windows Notepad and add the script below
  2. Save the file with a name like “CalendarColorScript.txt”
  3. Upload the text file to your library (Shared Documents in this example)

<script type="text/javascript" language="javascript">

  function CalColor()
  {
    var x = document.getElementsByTagName("div")
    var i=0;
    for (i=0;i<x.length;i++)
    {
      if (x[i].className=="ms-acal-item")
      {
        x[i].innerHTML= x[i].innerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>')
      }
    }
  }

  // hook into the SharePoint JS library to call our code
  // whenever the calendar is updated
  function CalHookIntoSPUI()
  {
    var originalCalendarNotify = SP.UI.ApplicationPages.CalendarNotify.$4a;
    //var originalresetSelection = SP.UI.ApplicationPages.CalendarViewBase.prototype.resetSelection;

    SP.UI.ApplicationPages.CalendarNotify.$4a = function()
    {
      originalCalendarNotify();
      CalColor();
    }
  }

  // add to the array of functions to run from the master page code
  if (!window.mikesCode)
  {
    mikesCode=new Array();
  }
  mikesCode[mikesCode.length] = "CalColor";
  mikesCode[mikesCode.length] = "CalHookIntoSPUI";

</script>

 

(updated 9/6/2011)

<script>
// Color coded calendars for SharePoint 2010
// TechTrainingNotes.blogspot.com

// load our function to the delayed load list
_spBodyOnLoadFunctionNames.push('colorCalendarEventLinkIntercept');

// hook into the existing SharePoint calendar load function
function colorCalendarEventLinkIntercept()
{

  if (SP.UI.ApplicationPages.CalendarNotify.$4a)
  {
    var OldCalendarNotify = 

SP.UI.ApplicationPages.CalendarNotify.$4a;
    SP.UI.ApplicationPages.CalendarNotify.$4a = function () 
      {
        OldCalendarNotify();
        colorCalendarEventLinks();
      }
  }
  if (SP.UI.ApplicationPages.CalendarNotify.$4b)
  {
    var OldCalendarNotify = 

SP.UI.ApplicationPages.CalendarNotify.$4b;
    SP.UI.ApplicationPages.CalendarNotify.$4b = function () 
      {
        OldCalendarNotify();
        colorCalendarEventLinks();
      }
  }
  // future service pack change may go here!
  // if (SP.UI.ApplicationPages.CalendarNotify.???)

}

// hide the hyperlinks
function colorCalendarEventLinks()
{

  // find all DIVs
  var divs = document.getElementsByTagName("DIV");
  for (var i=0;i<divs.length;i++)
  {
    // find calendar item DIVs
    if (divs[i].className.toLowerCase()=="ms-acal-item")
    {
divs[i].innerHTML = divs[i].innerHTML.replace(/&lt;/g,'<').replace(/&gt;/g,'>');
    }

    // find "x more items" links and re-remove links on Expand/Contract
    if (divs[i].className.toLowerCase()=="ms-acal-ctrlitem")
    {
      var links = divs[i].getElementsByTagName("A");
      if (links.length==1)
      {
        links[0].href="javascript:colorCalendarEventLinks();void(0);"
      }
    }

  }
}

</script>

 

Add a Content Editor Web Part to hold the JavaScript

  1. Go to the document library where you uploaded the script file, right-click the file name and select Properties
     
  2. Copy the URL to the file and click OK
     
  3. Display your calendar and select the view you modified earlier
     
  4. Click Site Actions and then Edit Page
     
  5. Click “Add a Web Part” and select the Content Editor web part
    image
     
  6. In the new web part’s dropdown menu click “Edit Web Part”
    image
     
  7. Paste in the URL to the script file you copied in step 2
     
  8. Click OK
     
  9. In the Ribbon click “Stop Editing” (in the Page tab)

 

Option #2 Using SharePoint Designer

This is the preferred method as it does not break view related functionality as does adding a web part.

  1. Go to the calendar in the browser and create a new view (maybe "Calendar - No Links")
     
  2. Open your site in SharePoint Designer 2010
     
  3. Click Lists and Libraries in the Site Objects pane
     
  4. Click your calendar list and click the new view
     
  5. In the ribbon click the "Advanced Mode" link (so you can edit the entire page)
     
  6. Search for "</WebPartPages:WebPartZone>" and insert a new line just after this tag
    </WebPartPages:WebPartZone>
      your customization goes here (don't type this J )
    </asp:Content>
     
  7. Add the JavaScript from below
     
  8. Save your changes in SharePoint Designer
     
  9. Go to the calendar, add a new event and select a color, and see if the colors are displayed.

 

Everything (or at least option #1) comes with a price   :-(

The above works! But… you lose one feature. When you add a web part to a view you lose the ability to select a view from the crumb trail. (This is not a problem if you add the code using SharePoint Designer)

Without a web part on the page:

image

 

With a web part on the page:  (this is our “Color Calendar” view)

image

 

Notice that the crumb trail now only has the list name. The view name is missing. When the view name is displayed then you also have the dropdown to select other views

You can still switch views, but you must first click in the calendar to display the ribbon.

Bug?  Probably.  (So use option #2 – add the code with SharePoint Designer)

 

Some thoughts on color options…

Just change the FONT tag to a SPAN tag and use a style. Example:

    ="<span style='background-color:"&Color&"'>"&Title&"</span>"

This works, but the background is for just the width of the text, not the entire table cell.

You will probably want to use colors like lightblue, lightgreen, tomoto (light red would just be Pink!), etc. or make the text white or a light color:

    ="<span style='color:white;background-color:"&Color&"'>"&Title&"</span>"

image

 

Closing Notes

  • Document everything, and add to your disaster recovery plan (otherwise you’ll never remember how you did this,and consider the poor person who inherits this site from you)
     
  • In researching the SP.UI.ApplicationPages.CalendarNotify update I found a blog article by Mark Wilson that also intercepted the SP.UI.ApplicationPages.CalendarViewBase.prototype.resetSelection function. My code seems to work fine without it. But in any case go take a look at Mark’s article to see another approach to color coded calendars.
     
  • This has been tested only with IE 8 and FF 3.5.9 so far.
     
  • Batteries not included, your mileage may vary, please test, test, test…

.

6/20/2010

Live Chats to Learn more about SharePoint - with 17 MVP Experts

 

 

Do you have questions about SharePoint?


Do you have questions about SharePoint? Want to learn more about the recently launched SharePoint 2010? By popular request, SharePoint MVPs from around the world are participating in a live chat event about SharePoint. These Q&A events are a great opportunity to tap into the vast knowledge of these industry professionals who are regarded as the best in their field.

Please join us on Wednesday June 23rd at 9am PDT! (12 noon EST) Learn more and add these chats to your calendar by visiting the MSDN event page http://msdn.microsoft.com/en-us/chats/default.aspx

 

On June 23rd, tune in between 9:00 - 10:00 AM Pacific time (12-1pm EST) to chat with the following MVPs:

1. Amanda Perran
2. Ben Curry
1. Bryan Phillips
4. Dan Attis
5. Daniel Larson
6. Jason Medero
7. Mike Oryszak
8. Muhanad Omar
9. Paul Schaeflein
10. Paul Stork
11. Randy Drisgill
12. Rob Foster
13. Saifullah Shafiq Ahmed
14. Serge Tremblay
15. Shane Perran
16. Spencer Harbar
17. Woody Windischman

 

Nope… I won’t be there!  :-(                I’ll be in class…  :-)

.

6/13/2010

OWA and the Twilight Zone?

 

I know I’m putting in too many hours and losing track of time, but either OWA (or FireFox) has lost it’s mind, or I have slipped off to the Twilight Zone…

 

I went to my calendar to check my class schedule, switched to Day view and got this:

             image

June has been tough, with 4 beta exams, classes and everything else, but that is a bit ridiculous! Three day weeks look good to me, but six week months will be a problem.

 

Then I heard about SharePoint Conference 2011 and decided to add that to my schedule…

            image

OWA thinks that 10/6/2011 is Thursday in the dropdown, but also Sunday in the popup calendar!  And… now there’s only six days in a week!

This is only a problem with FireFox (3.5.9). The calendars display fine with IE 7.   But. this just started this week!

 

So I think I’ll just get an ice tea and head out to the deck for a while…

 

.

6/11/2010

Planning WAY Ahead… Tech-Ed 2011!

Tech-Ed 2010 is over today… and I missed out this year  :-(

But,

Tech-Ed 2011 has been scheduled!

May 16-19 2011  in  Atlanta

 

Sign up for EARLY discounts by June 30th, 2010

http://northamerica.msteched.com/registration

 

Home page: http://northamerica.msteched.com

 

See you there!

 

.

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.