xslt - Grouping divs in rows (clarification needed) -


i realize @ programming , answers dependable.

is possible assist me in resolving issue having xslt code? i'm new progamming appreciate assistance can get.

your solution in grouping 3 divs in row found @ link below, not know how apply code. using sitecore , have div block corresponds each page generated produce metro-like blocks, 3 in row. far generates desired divs not put them 3 in row. code found below.

xslt how can wrap each 3 elements div?

i appreciate can get.

<?xml version="1.0" encoding="utf-8"?>  <!--=============================================================     file: servicesfeatureblocks.xslt                                                        created by: sitecore\admin                                            created: 3/27/2013 11:50:57                                                    copyright notice @ bottom of file ==============================================================-->  <xsl:stylesheet version="1.0"   xmlns:xsl="http://www.w3.org/1999/xsl/transform"   xmlns:sc="http://www.sitecore.net/sc"   xmlns:dot="http://www.sitecore.net/dot"   exclude-result-prefixes="dot sc">      <!-- output directives -->     <xsl:output method="html" indent="no" encoding="utf-8" />          <!-- parameters -->     <xsl:param name="lang" select="'en'"/>     <xsl:param name="id" select="''"/>     <xsl:param name="sc_item"/>     <xsl:param name="sc_currentitem"/>      <!-- variables -->     <!-- uncomment 1 of following lines if need "home" variable in code -->     <xsl:variable name="services" select="sc:item('/sitecore/content/home/services',.)" />     <!--<xsl:variable name="home" select="/*/item[@key='content']/item[@key='home']" />-->     <!--<xsl:variable name="home" select="$sc_currentitem/ancestor-or-self::item[@template='site root']" />-->          <!-- entry point -->     <xsl:template match="*">         <xsl:apply-templates select="$sc_item" mode="main"/>     </xsl:template>      <!--==============================================================-->     <!-- main                                                         -->     <!--==============================================================-->      <xsl:variable name="group" select="3" />      <xsl:template match="/">         <xsl:apply-templates select="$sc_currentitem[position() mod $group = 1]" />     </xsl:template>      <xsl:template match="item" mode="inner">         <div class="block orange">             <xsl:value-of select="sc:fld('title',.)" />         </div>          <item/>          </xsl:template>      <xsl:template match="item">         <div>             <xsl:apply-templates                 select="./item|following-sibling::services/item[position() &lt; $group]" mode="inner" />          </div>     </xsl:template>  </xsl:stylesheet> 

if can use sublayout instead of xslt rendering, can achieve functionality using listview grouptemplate

<asp:listview id="listview1" runat="server" groupitemcount="3" groupplaceholderid="groupplaceholder"                 itemplaceholderid="itemplaceholder">                 <layouttemplate>                     <div class="productscontent">                         <asp:placeholder id="groupplaceholder" runat="server"></asp:placeholder>                     </div>                 </layouttemplate>                 <grouptemplate>                     <div class="product-rows">                         <asp:placeholder id="itemplaceholder" runat="server"></asp:placeholder>                     </div>                 </grouptemplate>                 <itemtemplate>                     <div class="products">                     </div>                 </itemtemplate> </asp:listview> 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -