Solved

Problems linking document title to the document in XsltListViewWebpart

Posted on 2012-12-27
6
1,322 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Passing a TempVar to a Combo box form 3 107
SharePoint 2013 Blog Template 2 52
Initialize SharePoint Online List Values in Quick Edit 7 45
SharePoint 2013 with K2 5 28
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
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 create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

791 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