Sharepoint Insight by Namwar Rizvi

Sharepoint Tips, Tricks and inside knowledge from real world experience by Namwar Rizvi

Display “! Updated Today” indicator just like “! New” icon in Document Library

Posted by namwar on March 1, 2009


One of my cliens wanted to display “! Updated Today” icon (just like New icon) against all of those documents which are updated today so that their users can easily identify these documents. Since the customer just wanted this behaviour in some of the document libraries instead of all of them therefore, I opted to update the “AllItems.aspx” in Sharepoint Designer. By using a few lines of xsl code, I was able to achieve it. Following is the step-by-step procedure:

  1. Open the target page (normally it will be “AllItems.aspx”) in Sharepoint Designer
  2. Right click the ListViewWebPart and select Convert to XSLT Data View”
  3. context-menu

  4. Switch to Code view and search for 
    <xsl:if test="ddwrt:IfNew(string(@Created))"><IMG SRC="/_layouts/1033/images/new.gif" alt="New" /></xsl:if> 
  5. press Enter after the closing tag of above line i.e.  </xsl:if>
  6. Insert the following lines 
  7. <xsl:if test=”ddwrt:FormatDate(string(@Modified), number($Language), 1)=ddwrt:FormatDate(ddwrt:TodayIso(), number($Language), 1)”>

    <xsl:if test="ddwrt:FormatDate(string(@Modified), number($Language), 1)!=ddwrt:FormatDate(string(@Created), number($Language), 1)">

    <span style="background-color:maroon;color:white"> ! Updated Today</span>

    </xsl:if>

    </xsl:if>

     

  8. Save the file and refresh your browser.Bingo!  you will start getting “! Updated Today” indicator against all those files which are updated today similar to following:
  9. document-library1

Advertisements

8 Responses to “Display “! Updated Today” indicator just like “! New” icon in Document Library”

  1. Chris Sammut said

    Hi,
    When you convert to XSLT Data View, I lose the “edit in datasheet” functionality. Any idea how this can be resolved?

    Thanks
    Regards

    Chris

  2. mitun said

    When a new document is uploaded a green color text “! new” appears next to the newly uploaded document. How do I make this appear at document library level for example “shared documents ! new” whenever a new document/folder is uploaded/created in a document library?

  3. Noble said

    This code works great on my sharepoint list. Thank you. Is there any way to make the “! Updated Today” indicator show for the last seven days? I am not a programmer so I do not understand the formatting involved to do this. Again Thanks!!

  4. Cis said

    this code that I inserted into the allitems.aspx did not work. Maybe I’m missing something….can you please help me?

  5. Cis said

    i’d also like this for all site libraries.

  6. namwar said

    Hi Cis,
    Are you getting any error?

  7. Cis said

    Thank you, I figured it out. The open quotes were Italicized. I’d like this for all sites and document libraries which file to I edit?? Thank you very much, this is awesome.

  8. Luke T said

    Thanks, this is great!! 🙂

    Will this method also work on CQWPs as well as Data Views?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: