Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

A client's DVWP links aren't working after a move to 2010. A 3 layer grouping exists on the custom page. Year, Month, Dept. Documents exist just fine under this grouping. Once the Dept layer is expanded the list shows. The document icons make each file appear to be checked out (they are not) and the icon is not linked like it is in 2007. I am able to write some custom XSL and link the icon but not to my liking.

The issue is the web part looks at files from a different folder and I am having trouble linking to them cleanly. If I use @FileRef the path doubles (sites/folder/sub/sites/folder/sub) and if I use @FileLeafRef, the path stays in the current folder. I can hard code the server name and then @FileRef to make it work, but don't like that option. Here's a small code sample. Is there a better way to do this?

<a TABINDEX="-1" onclick="return...... target="_blank" href="http://MySrv/{@FileRef}"><IMG BORDER="0" alt="{@FileLeafRef}" title="{@FileLeafRef}" src="/_layouts/images/{ddwrt:MapToIcon(string(@HTML_x0020_File_x0020_Type),string(@File_x0020_Type))}" /></a>
share|improve this question
1  
a server-relative url href="/{@FileRef}" does not work? –  Derek Gusoff Jun 19 '13 at 20:21
    
Thanks for the reply. That was the first thing I attempted. It makes sense that should work but it did not. I also tried ./ –  Sean Jun 20 '13 at 16:30
    
Derek. I don't know why it didn't work day one, but it worked today. Please post as answer. –  Sean Jun 26 '13 at 19:42
    
"It makes sense that should work but it did not". That should be SharePoint's motto :) –  Derek Gusoff Jun 26 '13 at 20:04
add comment

1 Answer

up vote 1 down vote accepted

use a server-relative url href="/{@FileRef}" .

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.