you'll have to move the <div class="row"></div> out of the ProductInfo template and put it just after the for-each or just before, depending on whether you need to have a row for each product or just a single row div for all products.
<xsl:templatematch="/"> <divid="products"> <div class="row"> <xsl:for-eachselect="umbraco.library:GetXmlDocumentByUrl($productFeedUrl)//Product"> <div class="row"> <xsl:choose> <xsl:whentest="ProductInfoUrl != ''"> <xsl:variablename="productFeed"select="umbraco.library:GetXmlDocumentByUrl(ProductInfoUrl)"/> <xsl:choose> <xsl:whentest="$productFeed != ''"> <xsl:apply-templatesselect="$productFeed/ProductInfoList/*[position() mod $groupsize = 1]"mode="group"/> </xsl:when> <xsl:otherwise> This product could not be found </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> There are no products </xsl:otherwise> </xsl:choose> </div> </xsl:for-each> </div> </div> </xsl:template> <xsl:templatematch="ProductInfo"mode="group"> <xsl:apply-templatesselect=". | following-sibling::ProductInfo[position() < $groupsize]"mode="item"/> </xsl:template> <xsl:templatematch="ProductInfo"mode="item"> <divclass="item"> <ahref="{ProductURL}"class="itemImage"><imgsrc="{AboutProduct/ProductImage/PicBig}"alt="Image"/></a> <p><ahref="{ProductURL}"><xsl:value-ofselect="AboutProduct/SubHeadLine"/></a></p> <ahref="{ProductURL}"class="itemPrice">Date: <xsl:value-ofselect="umbraco.library:FormatDateTime(Dates/Date[1], 'd. MMM.')"/><br/><span><xsl:value-ofselect="PricePrefix"/><xsl:value-ofselect="Price"/><xsl:value-ofselect="umbraco.library:GetDictionaryItem('Price ending')"/></span></a> <ahref="{ProductURL}"class="itemButton">Buy to day</a> </div> </xsl:template>
Advanced for-each loop
This is in addition to jQuery tools scrollable - can it be done?
This is a little more complecated...
This works but the productItems are wrapped wrong.
The output is:
But I want this:
I have puzzled with it for some hours now, but can't calculate the currect solution... help will be appreseated.
you'll have to move the <div class="row"></div> out of the ProductInfo template and put it just after the for-each or just before, depending on whether you need to have a row for each product or just a single row div for all products.
Cheers,
/Dirk
Thanks Dirk.
I need a row for every 5 product. So I guess I need a bit more modification...
Hey! I solved it! Wohoo! :-)
The solution is: Gather the productfeeds in one variable and then output the data up to 5 items at a time.
The code:
Now it works perfect!
is working on a reply...