I've got a SharePoint site collection with several sub sites each having their own document library. Now I want to add the file extensions to the document names in all those libraries. How should I do this?
I've seen tips telling you to modify the onet.xml-file, but they never look like mine do, and furthermore I don't know for sure what happens to that onet.xml-file - does it change the existing libraries? Other tips tell me to use SharePoint designer, that would mean I'll have to do it for every view in every library, wouldn't it? So I'd prefer doing it from code, where I feel more comfortable and where I can automate the process.
So, all I want is to replace the "Name (linked to document with edit menu)" with the "Name (for use in forms)" but still keep the link and the edit menu. I've found I need to use the FileLeafRef-field, but I don't know how!sharepointsharepoint-2010
If you need to do it for only one library, sharepoint designer is the way to go. You can convert the view to XSLT view and use the FileLeaFref field.
If you want to do it for all the libraries, there is no easy way. You can replace the Name column but if you want to display the link and edit menu as well, you will need to go with some Jquery hack which I believe nobody has done till now.
You can follow below pts.
Modify the display pattern in ONET.XML -
After making a change to ONET.XML you have to do IISRESET. (BEFORE ALTERING ONET.XML, PLEASE TAKE BACKUP).
As changing WebPartPages with Sharepoint Designer is forbidden in our company, I had to find another workaround to this problem which works quite well for me. (but is probably not the most practical if you want to apply it to many lists at the same time). It doesn't replace the name-column, but adds an additional column only containing the file extension.
Actually I hoped to be able to do the same with a calculated field but so far did not succeed..