Solved

Problems linking document title to the document in XsltListViewWebpart

Posted on 2012-12-27
6
1,335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
User Profile Issue in SHarePoint 9 72
SharePoint Custom List 2010 Limitation? 1 45
Sharepoint 2010 2 27
REST call Failing 1 7
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. …
The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
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 viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

763 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