How can I match on multiple fieldrefs?
I've made a copy of
fldtypes.xsl in the
/_layouts/xsl/ directory where I can work with fields in my lists (I have to restart the web application to get it to take).
Now, I have this routine which will convert the text in a field into an icon by changing the display value of the field by adding some custom css classes (that supply the icons).
My problem is that I want to use this same template on more than one field ref. This one will run on any column in my portal with the title of
Yes or No Column, but I want it to match also on another column entitled
<!-- Convert the Fields into a status icons --> <xsl:template match="FieldRef[@Name='Yes or No Column']" mode="body"> <xsl:param name="thisNode" select="."/> <xsl:variable name="currentValue" select="$thisNode/@Yes_x0020_or_x0020_No_x0020_Column" /> <xsl:variable name="yes">Yes</xsl:variable> <xsl:variable name="no">No</xsl:variable> <xsl:choose> <xsl:when test="contains($currentValue, $yes)"> <span class="yesno yes"></span> </xsl:when> <xsl:when test="contains($currentValue, $no)"> <span class="yesno no"></span> </xsl:when> <xsl:otherwise> <span><xsl:value-of select="$currentValue" /></span> </xsl:otherwise> </xsl:choose> </xsl:template>
So how can I use the same template on mutliple fieldrefs?