1. May 2012 13:44
Replace Task List Status Column with Icons in SharePoint 2010
I've found myself recommending XSLT List Views as a solution for people recently when wanting to change the look and feel of their lists. This is a cool end user feature that I want to highlight here.
Picture the scene, you have a Task List but instead of the out of the box status such as In Progress, or Not Started you'd rather have a green or red graphic displayed. This is easy to achieve in two minutes using SharePoint Designer 2010 to edit the List View.
So, here we have a normal SharePoint Task List;
Open the site in SharePoint Designer, click on Lists and Libraries in the left navigation, then click on the Task List as below;
Then you need to select which view you're going to edit. I suggest the All Tasks view as shown;
Right click on the All Tasks view and select 'Edit File in Advanced Mode'
Now the best results for the next step require some information to be in the list. If there are no entries yet, you can ask SharePoint Designer to show some sample data (this doesn't change the list it's just an aid as you work). To do this, click on the list in the editor pane first, then you'll get some extra tools on the ribbon. Under the List View Tools banner, click the Design tab on the ribbon, and tick 'sample data' as so;
Five sample rows should now appear in your edit view below. Click into the 'Status 1' box, and when a little td tab appear there, click that to select the whole cell. [Note: do not click the Status header, click the Status 1 value otherwise you wont see what you need to]. It is essential you do it as shown.
Once the Status 1 cell has been selected by clicking that td tab, you'll see a pane on the right of the screen called 'Conditional Formatting'. This is going to apply formats to your task rows in the list based on the criteria you select next.
Click on Create -> Apply Formatting.
You'll now have the choice of selecting a field to make the decision on. Select the Status field, and set the criteria to when Status equals 'Not Started' then click the Set Style button;
FOr this example I'm setting an image as the background as per the screenshot below. You can see however that there's a lot of choices here to change font, background color, border, position etc. These are all options you could use instead. But for this example I'm setting the background image to be red.png, which is a icon I uploaded into SharePoint for the purpose. You could have any graphic you wanted. Be careful if the graphic you choose is too big - resize it, or click into Block -> Line Height to set the row to be big enough to accomodate your image.
One tacky hack I'm doing for this demo is to set the font color to the same color as my icon. That makes the text invisible for the purposes of this demo, though you have many options on what you could choose to do...
I then set up another condition for Status = 'In Progress' as I did the other one. I set a green icon, but the steps are the same as before..
After this you'll now see you have two conditions in the Conditioning Formatting pane on the right of the screen. This indicates things are going well...
I now create 2 tasks, one with a Status of 'Not Started' and the second with Status of 'In Progress'.
Lo and behold we now have colored graphics in place of the status text, which is potentially more eye catching than the plain text was..
Finally, just in case it's useful here are the icons I used;