Created
April 12, 2013 22:43
-
-
Save vgrem/5375785 to your computer and use it in GitHub Desktop.
Render Items in CQWP without duplicates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:template name="OuterTemplate.Body"> | |
<xsl:param name="Rows" /> | |
<xsl:param name="FirstRow" /> | |
<xsl:param name="LastRow" /> | |
<xsl:variable name="BeginColumn1" select="string('<ul class="dfwp-column dfwp-list" style="width:')" /> | |
<xsl:variable name="BeginColumn2" select="string('%" >')" /> | |
<xsl:variable name="BeginColumn" select="concat($BeginColumn1, $cbq_columnwidth, $BeginColumn2)" /> | |
<xsl:variable name="EndColumn" select="string('</ul>')" /> | |
<xsl:for-each select="$Rows"> | |
<xsl:variable name="CurPosition" select="position()" /> | |
<xsl:if test="($CurPosition >= $FirstRow and $CurPosition <= $LastRow)"> | |
<xsl:variable name="StartNewGroup" select="@__begingroup = 'True'" /> | |
<xsl:variable name="StartNewColumn" select="@__begincolumn = 'True'" /> | |
<xsl:choose> | |
<xsl:when test="$cbq_isgrouping != 'True'"> | |
<xsl:if test="$CurPosition = $FirstRow"> | |
<xsl:value-of disable-output-escaping="yes" select="$BeginColumn" /> | |
</xsl:if> | |
</xsl:when> | |
<xsl:when test="$StartNewGroup and $StartNewColumn"> | |
<xsl:choose> | |
<xsl:when test="$CurPosition = $FirstRow"> | |
<xsl:value-of disable-output-escaping="yes" select="$BeginColumn" /> | |
<!--xsl:call-template name="OuterTemplate.CallHeaderTemplate"/--> | |
<xsl:call-template name="OuterTemplate.CallGroupItem"> | |
<xsl:with-param name="CurPosition" select="$CurPosition" /> | |
</xsl:call-template> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:call-template name="OuterTemplate.CallFooterTemplate"/> | |
<xsl:value-of disable-output-escaping="yes" select="concat($EndColumn, $BeginColumn)" /> | |
<!--xsl:call-template name="OuterTemplate.CallHeaderTemplate"/--> | |
<xsl:call-template name="OuterTemplate.CallGroupItem"> | |
<xsl:with-param name="CurPosition" select="$CurPosition" /> | |
</xsl:call-template> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:when> | |
<xsl:when test="$StartNewGroup"> | |
<xsl:call-template name="OuterTemplate.CallFooterTemplate"/> | |
<!--xsl:call-template name="OuterTemplate.CallHeaderTemplate"/--> | |
<xsl:call-template name="OuterTemplate.CallGroupItem"> | |
<xsl:with-param name="CurPosition" select="$CurPosition" /> | |
</xsl:call-template> | |
</xsl:when> | |
<xsl:when test="$StartNewColumn"> | |
<xsl:choose> | |
<xsl:when test="$CurPosition = $FirstRow"> | |
<xsl:value-of disable-output-escaping="yes" select="$BeginColumn" /> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of disable-output-escaping="yes" select="concat($EndColumn, $BeginColumn)" /> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:when> | |
<xsl:otherwise> | |
</xsl:otherwise> | |
</xsl:choose> | |
<!--xsl:call-template name="OuterTemplate.CallItemTemplate"> | |
<xsl:with-param name="CurPosition" select="$CurPosition" /> | |
</xsl:call-template--> | |
<xsl:if test="$CurPosition = $LastRow"> | |
<xsl:if test="$cbq_isgrouping = 'True'"> | |
<xsl:call-template name="OuterTemplate.CallFooterTemplate"/> | |
</xsl:if> | |
<xsl:value-of disable-output-escaping="yes" select="$EndColumn" /> | |
</xsl:if> | |
</xsl:if> | |
</xsl:for-each> | |
</xsl:template> | |
<xsl:template name="OuterTemplate.CallGroupItem"> | |
<xsl:param name="CurPosition" /> | |
<xsl:value-of disable-output-escaping="yes" select="$BeginListItem" /> | |
<xsl:apply-templates select="." mode="itemstyle"> | |
<xsl:with-param name="CurPos" select="$CurPosition" /> | |
</xsl:apply-templates> | |
<xsl:value-of disable-output-escaping="yes" select="$BeginList" /> | |
</xsl:template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment