I'm trying to modify the out-of-the-box rendering of the xslt list view webpart to collapse the terms, and show (..more) if there are more than 1 term in the field. I already did this for an "Authors" field (user field), which shows a pop-up for the rest of the users using jQuery.
Maybe the pic will tell you more.
Now, I'm trying to do the same for a taxonomy field, but I'm not having much success. I checked the xslt from SPD, and copied it to my custom xslt file in VS2010, but it doesn't work.
This is the relevant part found in SPD (for the field "Country").
<xsl:template name="FieldRef_printTableCell_EcbAllowed.Country" match="FieldRef[@Name='Country']" mode="printTableCellEcbAllowed" ddwrt:dvt_mode="body" ddwrt:ghost="hide">
<xsl:param name="thisNode" select="."/>
<xsl:param name="class" />
<td>
<xsl:if test="@ClassInfo='Menu' or @ListItemMenu='TRUE'">
<xsl:attribute name="height">100%</xsl:attribute>
<xsl:attribute name="onmouseover">OnChildItem(this)</xsl:attribute>
</xsl:if>
<xsl:attribute name="class">
<xsl:call-template name="getTDClassValue">
<xsl:with-param name="class" select="$class" />
<xsl:with-param name="Type" select="@Type"/>
<xsl:with-param name="ClassInfo" select="@ClassInfo"/>
</xsl:call-template>
</xsl:attribute>
<xsl:apply-templates select="." mode="PrintFieldWithECB">
<xsl:with-param name="thisNode" select="$thisNode"/>
</xsl:apply-templates>
</td>
I tried modifying it by adding some random text messages inside the templates, so I know the xslt works, and finds the field. But it does not.
<xsl:template match="FieldRef[(@Encoded) and @Name='Country']" ddwrt:dvt_mode="body" mode="Lookup_body" ddwrt:ghost="hide">
Some random text
<xsl:param name="thisNode" select="."/>
<xsl:value-of select="$thisNode/@*[name()=current()/@Name]" disable-output-escaping="yes" /></xsl:template>
Usually, "Some random text" should also appear in the field, if it was a user field, or number etc. but this time it does not.
So I was wondering maybe you have an idea on how this custom rendering for taxonomy fields can be done.
