Creating a hyperlink in Data View Web Part/List
-
mardi 1 mai 2012 06:50
Hello,
I have some column values in a list that I would like to display as hyperlinks. Since they will be using a standard URL to open an InfoPath form using the InfoPath forms browser , the actual URL will be quite lengthy. Although it would be nice, I'll be using inline editing and I need to avoid creating a calculated column and using JavaScript to transform/format it nicely.
Can I modify the XLST to hyperlink all the columns in a Data View Web Part in SPD 2010 to achieve this? I'm a bit unsure of the syntax and where to put in the code so that it displays it through out all the columns.
I was thinking it'd be something like:
http://www.address.com/[COLUMNVALUE]/restofURL/here.html
Then the column would be displayed as "Form: [COLUMNVALUE2]" for each corresponding row and the appropriate column value.
Thank You.
Toutes les réponses
-
mardi 1 mai 2012 07:10
Hi
using SHPDesigner and an admin account
open the site
open the page
locate in the visual side the element where you need the hyperlink
next goto code side
There change the code as bellow
<a href="http://www.address.com/{@COLUMNVALUE}/restofURL/here.html"><xsl:value-of select={@COLUMN2}/></a>- Modifié romeo donca mardi 1 mai 2012 07:11
- Modifié romeo donca mardi 1 mai 2012 07:11
- Modifié romeo donca mardi 1 mai 2012 07:12
-
mardi 1 mai 2012 16:40
Hello,
I added the associated <a href ...> however the column is still not rendering as a hyperlink. On SPD, it does seem to navigate to the link if I hover over it, but when I see the page live, it is not functioning. Also, I imported the list as a data view web part through SPD 2010.Are there other steps to firstly configure it as a hyperlink?
-
mardi 1 mai 2012 18:28
You will need to right-click on the column in the XSLT List View and change the "Format As" to hyperlink. Then you can set your formula as the hyperlink and the displayed value of the field to whatever you desire.- Marqué comme réponse LetsSharePoints mercredi 2 mai 2012 01:11
-
mercredi 2 mai 2012 01:17
Thanks for all the help everyone.
I actually ended up creating a computed column with the link and parameter. In SPD 2010, I clicked the column cell and inserted a hyperlink, then referenced the computed column value. Then for what displayed, I hardcoded my own text using the hyperlink interface. When inline editing occurs, surprisingly, the user actually can't edit the hyperlink which is nice.
This thread was helpful too.

