SharePoint 2010 Removing the hyperlink in XSL for a Column

With SharePoint Designer you can easily add columns to the edit form for list items. So you go into the code view and add

<xsl:value-of select=”@MyColumn” />

the output is the href tag + the column value in full written. If you the add

disable-output-escaping=”yes”

the value will be displayed as hyperlink. Looks much better, but if you just want to have the value without the hyperlink you should add some functions to the select statement:

<xsl:value-of select=”substring-before(substring-after(@MyColumn, ‘&gt;’), ‘&lt;’)” disable-output-escaping=”yes”/>

This will display only the value of your column. Please replace MyColumn with your column name.

If you need a more detailed instruction, please look also at this post.

..:: I LIKE SHAREPOINT ::..

The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.

Karsten Pohnke About Karsten Pohnke
He is Consultant for SharePoint Solutions for collaboration, communication and business processes. He provides his customers applications based on standard features as well as development or combining the power of several microsoft tools like Dynamics CRM. In his free time he tries to collect tipps and worthy experience in this blog.

4 comments on “SharePoint 2010 Removing the hyperlink in XSL for a Column

  1. hi,
    i have same issue , but my look up field containing multible values.
    if i apply your substring trick, i am getting one value.

    may i know how can i get all values with out hyper links.

    thank you

  2. To do Multiple choice value lookups as text, use this as your Template instead (tested on SP2013):

    ;’)”>

    ;’), ‘>’), ‘<‘)” disable-output-escaping=”yes”/>
    |

    ;’)”/>

  3. Nevermind then, it can’t post html code properly. Maybe the moderator will fix it for me, otherwise it’s not worth the time to figure out how to fix the html to post here in a usable format.

  4. Trackback: URL

Submit comment

Allowed HTML tags: <a href="http://google.com">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>
quote
</blockquote>

Please fill in the captcha: * Time limit is exhausted. Please reload CAPTCHA.