views:

1923

answers:

4

I have a document library in MOSS 2007 which has folders and files. Document View in the document library has the following columns: document name, type, Created datetime, created by,modified datetime. How to configure the view so that it doesn't show any information for "modified", "created" and "created by" fields for folders. In other words,I want those fields to be empty for "folder" content types in document library document listing. Thanks in advance.

[Edit] Although, Paul-Jan's answer partially addresses my question, I still don't how to solve the columns "Created By" & "Modified By". There's no attribute to refer them in "Calculated Value". Kusek said "Editor" can be used to address the "Modified By" attribute of a document but that is not working

+5  A: 

You can use calculated columns to do this. For each column you want to have, create a calculated alternative, testing whether the content type is or isn't "folder". For example, you'd create a column ModifiedNoFolder, defined as

=IF([Content Type]<>"Folder",[Modified],"")

Make sure to assign the right type to the calculate column (datetime). Now remove the original Modified column from the view and add ModifiedNoFolder in stead.

Oh, and if you meant "in code" (making this question more programming-related), you could do the above in code. :-)

Paul-Jan
Thanks Paul-Jan. This works for "Modified" date time value but doesn't work for "Modified By". When I use, =IF([Content Type]<>"Folder",[Modified By],""), it says "One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas". I guess the "Modified By" is not a valid field to refer the user who last changed the document. Any solution?
BlueGene
For Modified By Field use "Editor" that is Internal Name
Kusek
@kusek =IF([Content Type]<>"Folder",[Editor],"") doesn't seem to be working. I still get that error message. Am I doing something wrong?
BlueGene
A: 

You could add javascript to the master page or the view's aspx page that will search the DOM for the relevant sections and hide them.

strongopinions
A: 

modified by = @Editor is in the form of html value.

brown
A: 

The suggested calculated column w/ formula: =IF([Content Type]<>"Folder",[Modified],"") will not work for documents being added to a library. Apparently this column is set before the modified date is set, so when upload the doc, the calculated column value will be set to "12/30/1899 12:00 AM" and the modified value will have the correct date/time

lucius