Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

How to structure CQWP XSL template with a table

$
0
0

I need to do something like a for each in the following code so that it doesn't make a new table for every record - just a Table Row:

<xsl:template name="TwoColumnRadContacts" match="Row[@Style='TwoColumnRadContacts']" mode="itemstyle"><div> <table style="width:100%"><tr><td style="width:50%"><xsl:value-of select="@DivName"/> </td><td style="width:50%;text-align:left"><xsl:value-of select="@WorkPhone"/></td></tr></table></div></xsl:template>

I know just enough about xsl in SharePoint to be dangerous. I know I need the table tags around the code that iterates the table ROWS, but I just don't know how to structure the for-each. I tried the following which didn't work:

<xsl:template name="2ColumnRadContacts" match="/" mode="itemstyle"><xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" /><table><xsl:for-each select="$Rows"><xsl:call-template name="dvt_1.rowview" /></xsl:for-each></table></xsl:template><xsl:template name="dvt_1.rowview"><tr><td><xsl:value-of select="@DivName" /></td><td><xsl:value-of select="@WorkPhone"/></td></tr></xsl:template>

However, it doesn't display correctly - it only shows @DivName, with no workphone and @DivName appears to be a link, which it shouldn't be.

What am I missing?



Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>