tag:help-archives.hannonhill.com,2010-02-09:/discussions/xslt-formats/6240-adding-subgroup-in-table-of-contents-pageCascade CMS: Discussion 2015-09-24T12:46:30Ztag:help-archives.hannonhill.com,2010-02-09:Comment/378715512015-09-15T13:30:51Z2015-09-15T13:30:51ZAdding subgroup in Table of Contents page<div><p>Hi Matthew,</p>
<p>I didn't have a chance to test any of this out, but perhaps what
you can do is replace the <code><xsl:for-each></code> with an
<code><xsl:apply-templates></code> and create two new
templates, one for this new folder and one to output those pages
and symlinks (ie the current code within the loop.</p>
<p>In theory, something like the following:</p>
<pre>
<code><xsl:template match="system-folder[display-name != ''] | system-page[display-name != '' and name != 'index' and name != 'presidents-message'] | system-symlink[name != '']" mode="top-level">
<xsl:param name="root-folder"/>
<h2 class="contentsArticleTitle col-lg-12 col-md-12 col-sm-12 col-xs-12">
<a>
<xsl:choose>
<xsl:when test="name(.) = 'system-symlink'">
<xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="name"/></xsl:attribute>
<xsl:value-of select="name"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:value-of select="path"/>
<xsl:if test="name(.)='system-folder'">/<xsl:value-of select="$default-page-name"/></xsl:if>
</xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="display-name"/></xsl:attribute>
<xsl:value-of select="display-name"/>
</xsl:otherwise>
</xsl:choose>
</a>
</h2>
<xsl:apply-templates select="descendant::system-folder[display-name != ''] | descendant::system-page[name!='index' and name != 'presidents-message' and display-name != ''] | descendant::system-symlink[name!='']" mode="sub-level"/>
</xsl:template>
<xsl:template match="system-folder[display-name != '']" mode="sub-level">
... Output custom stuff here ...
</xsl:template>
<xsl:template match="system-page[name!='index' and name != 'presidents-message' and display-name != ''] | system-symlink[name!='']" mode="sub-level">
<div class="contentsArticleSection pos1 col-lg-6 col-md-6 col-sm-6 col-xs-12">
<xsl:if test="position() mod 2 = 0"><xsl:attribute name="class">contentsArticleSection pos2 col-lg-5 col-md-5 col-sm-5 col-xs-12</xsl:attribute></xsl:if>
<div class="contentsArticleContent">
<xsl:if test="not(contains(display-name, 'A Message from the President'))">
<a>
<xsl:choose>
<xsl:when test="name(.) = 'system-symlink'">
<xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="name"/></xsl:attribute>
<xsl:value-of select="name"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:value-of select="path"/>
</xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="display-name"/></xsl:attribute>
<xsl:value-of select="display-name"/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:if>
</div>
</div>
</xsl:template></code>
</pre></div>Ryan Griffith