Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have document library with column LinkFilename which renders link to document, where text is the name of the file. Is it possible to modify column is such way, that it will still render link to document but the text will be coming from another field (eg. MyTitle)?

share|improve this question
add comment

2 Answers 2

It could be accomplished by customizing the Rendering of a Field on a List View using XSLT

Below is described solution using SharePoint Designer (SPD).

Solution

In SharePoint Designer (SPD) open view page (AllItems.aspx) in Designer Mode. Select list item in List View that have to be customized (Name column) and then click Customize Item as shown on picture below enter image description here

Switch to Code Mode and find template code for rendering LinkFilename generated by SPD

<xsl:template match="FieldRef[@Name='LinkFilename']" name="LinkFilenameNoMenu.LinkFilename" mode="Computed_LinkFilename_body" ddwrt:tag="a" ddwrt:dvt_mode="body" ddwrt:ghost="show">
...
</xsl:template>

Inside template replace the line for rendering FileLeafRef value:

<xsl:value-of select="$thisNode/@FileLeafRef.Name" />

with the following one:

<xsl:value-of select="$thisNode/@MyTitle" />

Note:
Custom field with internal name MyTitle is used here

After you save your changes your page should look like this one: enter image description here

share|improve this answer
    
Only works when Mytitle is also in the view, else its not a part of thisNode. –  Torsten Mar 24 at 14:31
add comment

Yes it is possible, when you select a field and go to further properties [as shown in the below article], you can choose which field should make the link and which to appear as text... These options are available when the field is supposed to work as HyperLink

Data View Web Part, The Basics - Add a Hyperlink

I hope this helps

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.