R – SharePoint Document Library Customization for document view

customizationdocument-librarymosssharepointsharepoint-2007

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

Best Answer

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. :-)