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

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

Share

8 thoughts on “Display "! Updated Today" indicator just like "! New" icon in Document Library”

  1. 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. 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. 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. this code that I inserted into the allitems.aspx did not work. Maybe I’m missing something….can you please help me?

  5. 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.

  6. Hi, I realise a long time has passed and no-one may be monitoring this article any more, but I have been trying to implement the code and I just get an error message. Is this code designed to work on a CQWP as well as a Data View? Also, can the code be placed within the ItemStyle.xsl file?

    Many thanks,

    Luke

Comments are closed.

Share via
Copy link
Powered by Social Snap