SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been struggling with this one for a couple days and figured it was time to ask for some help. I'm not sure if this is right forum, so if not please point me in the right direction.

Does anyone have a very simple XSL code that shows how to link a Title to it's document?

I have: - SP MOSS 2010 - A large document library (6500 documents in 15 folders) - Documents tagged with the "WorkCode" they belong to - A web part page stored in a serate library - A library web part that is filtered based on the "WorkCode" coloumn. (this webpart shows Type, and Title, plus two more custom columns) - Some coding skills with JS, CSS, HTML and XSL (bare minimum)

I do not have: - Access to SP Designer - An IT department that is willing to modify anything on the server side (or learn xsl)

My problem: SharePoint no longer links the Type icon to my documents(due to SP upgrade to 2010?) My filenames are terrible, so I want to link to the document Title instead of dispaying the Name. I have tried to make my own XSL file to link to from the web part's "Miscellanous" section. I can get the Title to appear, but I can't figure out how to get the hyperlink to the document.

This is some code I copied from: It links the Title, but the links all point back to the webpart page directory, and not the actual document.

<xsl:include href="/_layouts/xsl/main.xsl"/> 
<xsl:include href="/_layouts/xsl/internal.xsl"/> 

<xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() &gt;= $FirstRow and position() &lt;= $LastRow)]"/>
<xsl:param name="dvt_apos">'</xsl:param>

<xsl:template name="FieldRef_Text_body.Title" ddwrt:dvt_mode="body" match ="FieldRef[@Name='Title']" mode="Text_body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:param name="thisNode" select="."/>
        <xsl:when test="@AutoHyperLink='TRUE'">
            <a href="{$thisNode/@FileLeafRef}"><xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/></a>
            <a href="{$thisNode/@FileLeafRef}"><xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/></a>

I'm going nuts trying to figure this out!

Thanks in advance!

share|improve this question
You want to do it namely through tweaking XSL or you just want to do it (codeless)? – Gennady Vanin Геннадий Ванин Oct 25 '12 at 13:07
changing @FileLeafRef to @FileRef seems to work for me for now, but things go a little screwy if I try to to add groupings in the web part view. Gennady - If you have a codeless solution that you are willing to share, I would be very grateful. – Curt Oct 26 '12 at 18:09
Curt, sorry, I do not have a ready solution. I asked in order to know whether to start looking for that but I did not come to any – Gennady Vanin Геннадий Ванин Oct 27 '12 at 8:58

Your Answer


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

Browse other questions tagged or ask your own question.