Solved

Problems linking document title to the document in XsltListViewWebpart

Posted on 2012-12-27
6
1,276 Views
Last Modified: 2012-12-29
using SP2010 and SPD 2010

I have added a XLST lsit View for a document library to a SharePoint web page. I have added just the "Title" column  ( <xsl:value-of select="$thisNode/@Title" /> ) in the view . I am attempting to link the title back to the document using

<a href="{$thisNode/@FileRef.urlencodeasurl}"><xsl:value-of select="$thisNode/@Title" />

While in SPD 2010 this hyperlink works. When I view the page in a web browser , the link resolves to the folder of the web page. That is, if the web page is "\sites\MySite\default.aspx", the title link resolves to "\sites\MySite\" instead of the expected ""\Sites\MySite\MyDocumentLibrary\Document.pdf"

A little research and experimentation has revealed that if I add "URL path" as a second column to the view ,  the title hyperlink works fine. If I remove that and leave only the title column, the links no longer work.

I have seen a few other users are  having this problem and have yet to find a  solution that does not require coding changes at the server level (not allowed to do that here) or handcoding every single page. Our server  admins wish to to stay OOTB as much as possible, and will not support extensive manual coding.



Any suggestions on a resolution?
TileURLWorks.jpg
TileURLDoesNot-Work.jpg
0
Comment
Question by:CptO
  • 4
  • 2
6 Comments
 
LVL 16

Expert Comment

by:jessc7
ID: 38727479
Did you try selecting "Show Link to Item"? See screenshot...

Screenshot
0
 
LVL 16

Accepted Solution

by:
jessc7 earned 500 total points
ID: 38727632
Alternatively, have you thought about using a Data View Web Part rather than a List View Web Part? You would add a blank DVWP to your page, source the document library, pull in the fields you want, and customize your XSLT to match what you want.

This is the path I would go down. Here is a video from Laura Rogers on how to use a Data View Web Part:

Laura Rogers - SharePoint 2010 Data View and XSLT List View
http://www.youtube.com/watch?v=r2eODYHp73A
0
 

Author Comment

by:CptO
ID: 38727707
Hmm. If insert a the document library using insert DataView part (as I described in my first post, it does not work as described above. If I do as you suggest, and insert a blank DataView part, then source the same document library, I can use TITLE as a field and hyperlink it back to @fileref, and it works just as it did in SP 2007
using your suggestion the code I see is
<td class="ms-vb">
<a href="{@FileRef}"><xsl:value-of select="@Title" /></a></td>

Using my original method The code I see is

<xsl:choose>
<xsl:when test="@AutoHyperLink='TRUE'">
 <a href="{$thisNode/@FileRef}"><xsl:value-of select="$thisNode/@*[name()=current()/@Name]" disable-output-escaping="yes" /></a></xsl:when>
<xsl:otherwise>
        <xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/>
      </xsl:otherwise>
</xsl:choose>


Out of curiosity , and for my own knowledge, any idea whyyour suggestion work and my method does not? On the surface it appears to be the same method except one is the SP2010 new method and the other is the SP2007 method.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 16

Expert Comment

by:jessc7
ID: 38727760
To be honest, I'm not really sure why you (and others) have encountered that issue with the List View Web Part, but I have found the Data View Web Part to be more flexible for what I want to accomplish.
0
 

Author Comment

by:CptO
ID: 38728055
I agree and thanks got the answer. I was under the impression, after many hours of looking, that the 2007 Style DVWP no longer existed unless you manually coded it. It appears I was wrong and Microsoft just made it difficult to find. Again thanks got the answer. It will simify a lot of changes I need to make after our migration to 2010.
0
 
LVL 16

Expert Comment

by:jessc7
ID: 38729368
Glad to help! Good luck with your migration.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now