Warning: file_put_contents() [function.file-put-contents]: Only 0 of 196 bytes written, possibly out of free disk space in /disk2/home/symphonyweb/public_html/extensions/xmlfield/fields/field.xml.php on line 63
“group by position” – XSLT Utilities – Download – Symphony.
Author:
Cremol
Version:
1.0
Release Date:
14 Nov 2011
Category:
Output

Description

This utility applies a template loop for multiple items instead of just one item
View example

XSLT

View Raw
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
	<xsl:apply-templates select="entry[position() mod 4 = 1]" mode="group" />
</xsl:template>

<xsl:template match="entry" mode="group">
    <div class="groupitems">
        <xsl:apply-templates select=". | following-sibling::entry[position() &lt; 4]" mode="content" />
    </div>
</xsl:template>

<xsl:template match="entry" mode="content">
    <!-- Content goes here: for example: <h1><xsl:value-of select="title"/></h1> -->
</xsl:template>

</xsl:stylesheet>

Discuss this XSLT Utility

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details