You are my hero. I was searching for this exact information on the web - found some posts about displaying the document icon, but you were the only one I found to post about the "new" icon. Thank you so much!
Insert this code into the XSL of a data view (or data form) web part - this can be done using the code view of the page you are editing in SharePoint Designer.
The XSL of the web part defines what data fields will appear in what rendered HTML - you need to be able to be comfortable with understanding and editing XSL inside of SharePoint Designer to use the code in this post.
Thanks. Works great. Do you know of a way to lengthen the time to display the "New" icon without altering the server configuration...so I can have custom length for each list?
Karen, you could use some additional XSL handling to adjust the @Created date value in the "IfNew" ddwrt command.
For example, you could get today's date using ddwrt:Today() and use that to adjust the @Created date, or add some value to the @Created date inside the IfNew() method call using XSL functions. Here are some details of the ddwrt functions.
I am Gary Payne, an independent consultant and developer specializing in all matters SharePoint. From developing intranets and business applications, right through to supporting and troubleshooting SharePoint deployments, I am here to help.
My current professional interests include creating visualizations using D3 in SharePoint, and the use of Visual Studio Code for streamlining custom front-end code development.
For more information on my services, please check my web site at www.smallsteps.co.nz
10 comments:
You are my hero. I was searching for this exact information on the web - found some posts about displaying the document icon, but you were the only one I found to post about the "new" icon. Thank you so much!
Where does this code go?
Insert this code into the XSL of a data view (or data form) web part - this can be done using the code view of the page you are editing in SharePoint Designer.
The XSL of the web part defines what data fields will appear in what rendered HTML - you need to be able to be comfortable with understanding and editing XSL inside of SharePoint Designer to use the code in this post.
Thanks. Works great. Do you know of a way to lengthen the time to display the "New" icon without altering the server configuration...so I can have custom length for each list?
Karen, you could use some additional XSL handling to adjust the @Created date value in the "IfNew" ddwrt command.
For example, you could get today's date using
ddwrt:Today()
and use that to adjust the @Created date, or add some value to the @Created date inside the IfNew() method call using XSL functions. Here are some details of the ddwrt functions.
Thank you, thank you, thank you! Just what I was looking for.
Can it be added to the content query tool webpart? I have tried to implement it through the itemStyle.xsl but returned with error. Any ideas, please?
Sam
See this post on adding the !new tag to the CQWP - it's all about the namespace...
http://www.sharepointblogs.com/joed/archive/2008/02/03/display-a-quot-new-quot-indicator-in-the-content-query-web-part.aspx
This is ace, thanks so much for posting!
Post a Comment