Custom xsl rendering for lookup field in list view (SharePoint 2010)
Posted
by Luc
on Stack Overflow
See other posts from Stack Overflow
or by Luc
Published on 2010-05-28T13:00:11Z
Indexed on
2010/05/29
10:22 UTC
Read the original article
Hit count: 717
sharepoint
|sharepoint2010
I'm trying to change rendering of a list column on list view page.
After a few tutorials and some hair pulling I managed to create an xslt for a calculated and currency field (from fldtypes_XXXXXX.xsl):
<xsl:template match ="FieldRef[@Name='MarkCalc']" mode="Text_body">
<xsl:param name="thisNode" select="."/>
<xsl:value-of select="$thisNode/@*[name()=current()/@Name]" disable-output-escaping ="yes"/>
</xsl:template>
<xsl:template match="FieldRef[@Name='CurrencyTest']" mode="Number_body">
<xsl:param name="thisNode" select="."/>
<b><xsl:value-of disable-output-escaping="yes" select="$thisNode/@*[name()=current()/@Name]" /></b>
</xsl:template>
Then I tried to do the same for a lookup field, but it just won't work. This is my last attempt (I copied it from SharePoint designer). What am I missing?
<xsl:template match="FieldRef[(@Encoded) and @Name='Lookup1']" mode="Lookup_body">
<xsl:param name="thisNode" select="."/>
<b><xsl:value-of select="$thisNode/@*[name()=current()/@Name]" disable-output-escaping="yes" /></b>
</xsl:template>
© Stack Overflow or respective owner