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.

About Karsten Schneider 312 Articles
Consultant for Microsoft 365 Applications with a strong focus in Teams, SharePoint Online, OneDrive for Business as well as PowerPlatform with PowerApps, Flow and PowerBI. I provide Workshops for Governance & Security in Office 365 and Development of Solutions in the area of Collaboration and Teamwork based on Microsoft 365 and Azure Cloud Solutions. In his free time he tries to collect tipps and worthy experience in this blog.

3 Comments

  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.

1 Trackback / Pingback

  1. URL

Leave a Reply

Your email address will not be published.


*