locked
How to show a file extension within a document library view RRS feed

  • Question

  • Is it possible to enable file extensions to be shown when looking at documents within a document library.  In some instance, files that are outside of the standard range either don't have an appropriate icon or shares the same icon type as another file.  In this instance, my options are: -

     

    1 - Add icons for these varied filetypes (Can be done, I'm not sure how)

    2 - Show the file types within the document library views (can this be done?)

    3 - An option of which I'm unawares.

     

    If anyone has any input here, I'd be grateful.

    Thursday, November 15, 2007 2:38 PM
    Answerer

Answers

  • Hi Steven, there's an easy way to do it, but you'll need SharePoint Designer.

     

    1. Open SharePoint Designer
    2. Select the WebPartPages:ListViewWebPart control
    3. Right-click, Convert to XSLT Data View
    4. Insert a new column into the data view
    5. I typed "Extension" in the gray header row
    6. In the first row below the header, right click and choose Insert Formula -> Expand the tree under Rows, Row, and select File Type, click OK.

    You should now see the file extensions shown in data view.

     

    --Hagen

    Thursday, November 15, 2007 6:39 PM
  • I tried it and the formula is

    @FileLeafRef

    This will display the name of the file including the extension. I created one new view in the library which is based on the "All Documents" view called someoneelse. Opened the someoneelse.aspx in Sharepoint Designer and followed the first 3 points of the upper instructions. The next steps were

    4. Right-click to the first item at the row "Name" and select "Insert Formula"
    5. In the upper right hand box delete the existing entry and insert @FileLeafRef

    This will display the "Name (linked to document with edit menu)" row with file extension. After the file is saved in Sharepoint Designer the someoneelse view can't be edited in the Sharepoint site settings.
    • Marked as answer by Mike Walsh FIN Tuesday, January 11, 2011 11:44 AM
    Monday, August 17, 2009 4:35 PM

All replies

  • Hi Steven, there's an easy way to do it, but you'll need SharePoint Designer.

     

    1. Open SharePoint Designer
    2. Select the WebPartPages:ListViewWebPart control
    3. Right-click, Convert to XSLT Data View
    4. Insert a new column into the data view
    5. I typed "Extension" in the gray header row
    6. In the first row below the header, right click and choose Insert Formula -> Expand the tree under Rows, Row, and select File Type, click OK.

    You should now see the file extensions shown in data view.

     

    --Hagen

    Thursday, November 15, 2007 6:39 PM
  •  

    What does it mean: 'Select the WebPartPages:ListViewWebPart control' ?

    I've downloaded Sharepoint Designer, started and connected to my Sharepoint website but I do not see anything which looks like 'WebPartPages:ListViewWebPart'.

     

    -- Helmut

    Friday, November 23, 2007 11:14 AM
  • Hagen

     

    This shows the extension as an extra column. Is it possible to change the display pattern of the filename to include the extension? eg filename.ext

     

    I was able to do this by editing the onet.xml file in WSS 2 but have been unable to work a solution in WSS 3.

     

    Thanks

    Shaun

    Tuesday, November 27, 2007 10:37 AM
  • Once you have opened the aspx file (I copy the Library View address to the open box), and the page is displayed in the middle of the screen, right click on the rows of data area of the page.  This is the "WebPartPages:ListViewWebPart Control"

     

    Hope this helps

     

    Thursday, May 15, 2008 11:14 PM
  • In WSS 3.0 using SharePoint Designer, you can insert a column (I call it Filename). Right click in the first row of that column and select insert formula.  In the upper right hand box enter @FileListRef

     

    This should display the filename.Ext

     

    Be warned once you edit the WebPart with SharePoint you will no longer be able to edit it with anything else as far as I can find.

     

    • Proposed as answer by Udo T Monday, August 17, 2009 4:18 PM
    • Unproposed as answer by Mike Walsh FIN Tuesday, January 11, 2011 11:44 AM
    Thursday, May 15, 2008 11:31 PM
  • I tried it and the formula is

    @FileLeafRef

    This will display the name of the file including the extension. I created one new view in the library which is based on the "All Documents" view called someoneelse. Opened the someoneelse.aspx in Sharepoint Designer and followed the first 3 points of the upper instructions. The next steps were

    4. Right-click to the first item at the row "Name" and select "Insert Formula"
    5. In the upper right hand box delete the existing entry and insert @FileLeafRef

    This will display the "Name (linked to document with edit menu)" row with file extension. After the file is saved in Sharepoint Designer the someoneelse view can't be edited in the Sharepoint site settings.
    • Marked as answer by Mike Walsh FIN Tuesday, January 11, 2011 11:44 AM
    Monday, August 17, 2009 4:35 PM