Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Problems linking document title to the document in XsltListViewWebpart

Posted on 2012-12-27
6
Medium Priority
?
1,424 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 2000 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

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
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

596 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