Saw a cool way to modify a list view to show the attachment filenames. Original post is from Alex Dean here and I wanted to expand upon it:
1) Open the site up in SharePoint Designer, click on the list where you'd like to add the column with filenames, and pick the view that you'd like to edit (e.g. AllItems.aspx)
2) Right click on the area displaying the view and select "Convert to XSLT Data View"
3) Then view the new web part, and search for the header row (it begins with):
<!--Attachments--><TH nowrap="" scope="col" class="ms-vh-icon">
after the </TH>, add the following:
<TH nowrap="" scope="col" class="ms-vh2">File Names</TH>
4) Scroll down a bit until you hit the rows:
<!--Attachments-->
<TD Class="{$IDAKFYXG}">
<xsl:if test="not (@Attachments=0)"><img border="0" src="{$HttpVDir}/_layouts/images/attach.gif" /></xsl:if>
</TD>
and add the following afterwards:
<td>
<SharePoint:AttachmentsField
ControlMode="Display"
ItemId="{@ID}"
FieldName="Attachments"
runat="server"/>
</td>
Press save and you should see the filenames show up in your List View!
3 comments:
can this be done using SharePoint 2013 and SharePoint designer 2013?
Haven't tried it myself but there's no reason it shouldn't work in SharePoint 2013.
Step 2... Is this in the code view area?
As there's no design view in SPD2013 Code view area is all that's visible.
Post a Comment