So this is what I came up with:
The solution I came up with was actually quite straightforward.
First I scanned through all Field, List and Site definition files in the 12 Hyve for any occurrences of the image file new.gif. You would quickly find that the New icon is rendered using the following CAML syntax:
1: <IfNew Name="Created_x0020_Date">
2: <HTML><![CDATA[<IMG SRC="/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/images/new.gif" alt="]]></HTML>
3: <HTML>$Resources:core,new_gif_alttext</HTML><HTML><![CDATA[">]]></HTML>
4: </IfNew>
The CAML element IfNew is used against the list item column that holds the creation date. As you probably know, you can control the number of days that SharePoint should display the New icon using an Stsadm command. Let's say you need to show the icon for 5 days, you would apply that setting like this:
stsadm -o setproperty -pn days-to-show-new-icon -pv 5
But is there a CAML element that does the same for modifications? i.e. IfModified or IfUpdated. Because we need to show our Updated icon whenever a list item is modified. Well, CAML does not have an element like that available. So I thought, why cannot we use the same IfNew element in combination with the Modified item field that holds the date of the last modification. That did the trick! Basically you can throw any date column at the IfNew element!
So here is the CAML code what we ended up with. This replaces the four lines of CAML syntax above wherever we needed to display the new Updated icon:
1: <IfEqual>
2: <Expr1>
3: <Column Name="Created_x0020_Date" Format="DateOnly" />
4: </Expr1>
5: <Expr2>
6: <Column Name="Modified" Format="DateOnly" />
7: </Expr2>
8: <Then>
9: <IfNew Name="Created_x0020_Date">
10: <HTML><![CDATA[<IMG SRC="/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/images/new.gif" alt="]]></HTML>
11: <HTML>$Resources:core,new_gif_alttext;</HTML>
12: <HTML><![CDATA[">]]></HTML>
13: </IfNew>
14: </Then>
15: <Else>
16: <IfNew Name="Modified">
17: <HTML><![CDATA[<IMG SRC="/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/images/Workfox/updated.gif" alt="updated">]]></HTML>
18: </IfNew>
19: </Else>
20: </IfEqual>
First I check if the creation date is equal to the last modification date, because if that is the case, we want to show the New icon if the IfNew element evaluates to true against the Created_x0020_Date field.
If the last modification date is not equal (bigger) to the creation date, we check to see if the Modified column evaluates to true against the IfNew element and in that case show the Updated icon.
So all you need to do is create an icon (or use this one:
If you like this post then please consider subscribing to my full feed RSS. You can also subscribe by Email and have new articles sent directly to your inbox.

