SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Salvete! In my list, I have a column formatted as a Number, titled, say, "My Number", and the actual markup name of the column is "My_Number".

Now, I want to convert the entire column, in any list, into a hyperlink, so that the link becomes something like "My Number"

I have read here and here, and Microsoft's page, too, that this might be accomplished with xslt, but even after an iis reset, I can't seem to change the field values into the links that I want. Here is my custom fldtypes_MyNumber.xsl, which is placed in the /_layouts/XSL directory:

exclude-result-prefixes="xsl msxsl ddwrt" 

<xsl:template match="FieldRef[@Name='My_Number']" >
    <xsl:param name="thisNode" select="."/>
    <a target="_blank" href="/mypages/mysite{$thisNode/@My_Number}">{$thisNode/@My_Number}</a>

So what do I do to get this to work?


I changed mode=Number to mode=Number_body and now the hyperlink is generated and inserted properly! However, the hyperlink text label is rendered literally... How do I use the text that was originally there as a variable?

share|improve this question
up vote 1 down vote accepted

Got it! It was a matter of manipulating xsl markup in the right fashion. Here is the final result. It transforms an ordinary number in a Number column into a hyperlink.

<xsl:template match="FieldRef[@Name='My_Number']" mode="Number_body">
<xsl:param name="thisNode" select="."/>
    <a target="_blank">
    <xsl:attribute name="href">/mypages/mysite<xsl:value-of select="$thisNode/@My_Number"/></xsl:attribute>
    <xsl:value-of select="$thisNode/@My_Number" />
share|improve this answer

Your Answer


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.