For lack of a better name: blog

29Dec/102

Status alerts in SharePoint

Sometimes you want to inform your users, maybe about a network error, planned updates or so. So why not use the out of the box status function from SharePoint for this purpose? See the image for an example.

clip_image002

 

Step 1: Create a custom list

1. First we need a list named Statusalerts where we can add the alerts that need to be displayed. This list can be added everywhere in SharePoint.

2. Add 2 extra fields to this list:

Color

Choice field, with the options: red, yellow, blue, green

Message

Single line of text
The title field will be used for the first (bold) part of the status update, the color will define the background color and the message will be the message.

3. Add a test item.

Step 2: Create the script

clip_image0041. Download this statusalerts.txt file and add it to a document library.

2. If jQuery already is loaded on the page, remove the first line from the text file.

3. Change the *your sharepoint url* part in the txt file to your SharePoint site url where the Statusalerts list is. Please test the full url (including the /_vti_bin/lists.asmx) before proceeding.

Step 3: Load the script

1. Add a content editor webpart to the page

2. Fill in the url to the statusalerts.txt file in the content link field

3. Change the title

4. Set the chrome type to none

Step 4: Test

If evertyhing is correctly configured there should be a status bar on the page where the content editor webpart is added.

clip_image006

When there are multiple items all the items will be displayed with the same color:

clip_image008

Sources and more info?

http://msdn.microsoft.com/en-us/library/ff410028.aspx
http://weblogs.asp.net/jan/archive/2009/04.aspx

Posted by Alexander Ketelaar

Comments (2) Trackbacks (0)
  1. Cool, to make it work in Chrome change:
    $(xData.responseXML).find(“z\\:row”).each(function() {

    into:
    $(xData.responseXML).find(“[nodeName='z:row']“).each(function() {


Leave a comment

(required)

No trackbacks yet.