SharePoint Document Library !New icon


Taking a look at the onet.xml (located in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\GLOBAL\XML) I did a search for the new.gif and found it surrounded by an <IfNew> element.  A search on MSDN leads to this document which states:

"Returns TRUE if the item is considered new. Usually, this means that the item was created after midnight the day before. This element renders its contents if the item was created today, that is, after only one day has passed, the number of days being a registry setting for which the default value is 1."

I had to read that a few times, but it boils down to two days.

To check that, run:

stsadm -o getproperty -propertyname days-to-show-new-icon -url "<site_url>" 

It returns 2.
If you want to change it, run:
stsadm -o setproperty -pn days-to-show-new-icon -pv <number_of_days> -url "<site_url>"

Example :

  1. Click Start, point to All Programs, point to Accessories, and then click Command Prompt. or goto MS Power shell
  2. Type the following commands, and then press ENTER after each command:

1. getproperty

PS C:\Users\Administrator> stsadm -o getproperty -propertyname days-to-show-new-
icon -url "
http://192.168.1.40:6855"

<Property Exist="Yes" Value="2" />PS C:\Users\Administrator> stsadm -o setproper
ty -pn days-to-show-new-icon -pv 2 -url "http://inddev16:7576"

Operation completed successfully.
 
2. setproperty

PS C:\Users\Administrator> stsadm -o setproperty -pn days-to-show-new-icon -pv 0
 -url "
http://192.168.1.40:6855"

Operation completed successfully.

No comments:

Powered by Blogger.