Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi to all,
I have a parent node which have 6 child nodes. Now I want to loop through all these nodes, but grouping them in different divs with a chunk of 3 nodes each.
parent node
-- child 1
-- child 2
-- child 3
-- child 4
-- child 5
-- child 6
like:
<div class="group1">
<div>child1 </div>
<div>child2 </div>
<div>child3 </div>
</div>
<div class="group2">
<div>child4 </div>
<div>child5 </div>
<div>child6 </div>
Look here
http://our.umbraco.org/forum/developers/xslt/4473-Odd-Even-using-position
Rich
Hi praveity,
I explained a similar issue here: http://our.umbraco.org/forum/developers/xslt/11527-Problem-with-listing-HTLM-strcuture-with-XSLT
/Chriztian
Hi Rich,
I want chunks of first 3 child nodes to be in one div and then another 3 child nodes on another div.
The examples shown list the even positioned node to one group and odd-positioned to another.
I want nodes positioned 1,2,3 on one div and nodes positioned 4,5,6 on another div.
<xsl:template match="/"> <!-- start writing XSLT --> <xsl:for-each select="$currentPage/CB_Page[@isDoc] | $currentPage/CB_NewsGroup[@isDoc]"> <xsl:variable name="pos" select="position()"/> <xsl:if test="$pos <= 3"> <div class="holder"> <xsl:call-template name="renderContent"> </xsl:call-template> </div> </xsl:if> <xsl:if test="$pos >3 and $pos <=6"> <div class="holder"> <xsl:call-template name="renderContent"> </xsl:call-template> </div> </xsl:if> <xsl:if test="$pos > 7"> <div class="holder"> <xsl:call-template name="renderContent"> </xsl:call-template> </div> </xsl:if> </xsl:for-each> </xsl:template>
I just want class holder to be repeated only once for the child nodes 1,2,3.
Then repeat it again for chlid nodes 4,5,6 and so on.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
group 3 items as one set for div in <for:each/>
Hi to all,
I have a parent node which have 6 child nodes. Now I want to loop through all these nodes, but grouping them in different divs with a chunk of 3 nodes each.
parent node
-- child 1
-- child 2
-- child 3
-- child 4
-- child 5
-- child 6
like:
<div class="group1">
<div>child1 </div>
<div>child2 </div>
<div>child3 </div>
</div>
<div class="group2">
<div>child4 </div>
<div>child5 </div>
<div>child6 </div>
</div>
Look here
http://our.umbraco.org/forum/developers/xslt/4473-Odd-Even-using-position
Rich
Hi praveity,
I explained a similar issue here: http://our.umbraco.org/forum/developers/xslt/11527-Problem-with-listing-HTLM-strcuture-with-XSLT
/Chriztian
Hi Rich,
I want chunks of first 3 child nodes to be in one div and then another 3 child nodes on another div.
The examples shown list the even positioned node to one group and odd-positioned to another.
I want nodes positioned 1,2,3 on one div and nodes positioned 4,5,6 on another div.
I just want class holder to be repeated only once for the child nodes 1,2,3.
Then repeat it again for chlid nodes 4,5,6 and so on.
is working on a reply...