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 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: http://blogs.captechconsulting.com/blog/chris-okeefe/sharepoint-2010-add-%E2%80%9Clinked-titles%E2%80%9D-document-based-list-view-web-parts 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:choose>
        <xsl:when test="@AutoHyperLink='TRUE'">
            <a href="{$thisNode/@FileLeafRef}"><xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/></a>
        </xsl:when>
        <xsl:otherwise>
            <a href="{$thisNode/@FileLeafRef}"><xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/></a>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

I'm going nuts trying to figure this out!

Thanks in advance!

share|improve this question
1  
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

 
discard

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

Browse other questions tagged or ask your own question.