• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1027
  • Last Modified:

map out SharePoint column as link through XSLT

I am creating an XSLT style which, as one of the requirements, pulls a url from a column, and displays the link with the anchor tag around it.

I created a custom column called "webpage", and although I am able to get the link to render, I don't know how to structure the XSLT to make the link work.

Here is what I have so far:

<xsl:template name="Aspiro-ResourceProfiles" match="Row[@Style='Aspiro-ResourceProfiles']" mode="itemstyle">
      <div class="ResourceProfile">
    	<h2><xsl:value-of select="@Title" disable-output-escaping="yes"/></h2>
    	<xsl:if test="@Byline !=''"><!-- conditional Byline if NOT empty -->
    		<p><xsl:value-of select="@Byline" disable-output-escaping="yes" /></p>
    	</xsl:if>
<p><a href=""><xsl:value-of select="@WebPage" disable-output-escaping="yes" /></a></p>
    	<p><xsl:value-of select="@Description" disable-output-escaping="yes" /></p>
    	<p><strong>Keywords: </strong><xsl:value-of select="@Keywords" disable-output-escaping="yes"/></p>
      </div>	
    </xsl:template>

Open in new window


The other weird thing is that even though I can output the name it renders twice with a comma separating them. I'm not sure why.

example of duplication
Thanks for the assistance!
0
cnibspteam
Asked:
cnibspteam
  • 2
1 Solution
 
Geert BormansCommented:
try
><a href="{@WebPage}"><xsl:value-of select="@WebPage"/></a></

instead of

><a href=""><xsl:value-of select="@WebPage" disable-output-escaping="yes" /></a></

you need of course to fill in the href attribute
I don't know why you see the link double
please check it is not duplicated in the source table
0
 
cnibspteamAuthor Commented:
Great -  that worked. Thanks.

It seems that the duplication is caused by the type of column I used which uses the URL and Description. If you don't input a description it duplicated the URL in that field.

I'm just going to have to use a different column instead. Thanks for the help!
0
 
Geert BormansCommented:
welcome
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now