Custom xsl rendering for a search field in a list view (SharePoint 2010)

I am trying to change the rendering of a list column on a list view page.

After several training lessons and hair pulling, I managed to create xslt for the calculated and currency fields (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 the search field, but that just wouldn't work. This is my last attempt (I copied it from the 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>
+5
source share
2 answers

As it turned out, this is completely an xsl problem.

Xsl "match" "mode". . , , .

http://www.codetoad.com/xml/xslt8.asp:

  • , , *, , -0.5

  • , , , , 0

  • , , CastMember/Character,  ,  , 0,5

, , : - node 0,5. , Description/Link/Character , //Character.

SharePoint

<xsl:template name="FieldRef_Lookup_body" match="FieldRef" mode="Lookup_body" ddwrt:dvt_mode="body">...

<xsl:template match="FieldRef[@Encoded]" mode="Lookup_body" ddwrt:dvt_mode="body">

0 ( ), 0,5 ( ).

,

<xsl:template match="FieldRef[(@Encoded) and @Name='Lookup1']" mode="Lookup_body">...

0,5 (, "... , ..." ), xsl (*).

, , . 1.

<xsl:template match="FieldRef[(@Encoded) and @Name='Lookup1']" priority="1" mode="Lookup_body">...



(*) -, SharePoint . , , xsl, .

+8

All Articles