• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1030
  • 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 BormansInformation ArchitectCommented:
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 BormansInformation ArchitectCommented:
welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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