I needed to display in homepage the subcategories of a given category.
I'm leaving this here as a memo, maybe it will be useful to someone else.
that's what i did:
0. created an appconfig for my special category (different from IsFeaturedCategoryID).
I called it IsFeaturedHomeCategoryID
1. created an xmlpackage starting from rev.cat.tabs.xml.config.
I called it rev.category.featuredhome.xml.config
Code:
<package version="2.1" displayname="Categories" debug="true" includeentityhelper="true">
<PackageTransform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:param name="CategoryID" select="aspdnsf:AppConfig('IsFeaturedHomeCategoryID')" />
<xsl:template match="/">
<xsl:for-each select="/root/EntityHelpers/Category//Entity[ParentEntityID = $CategoryID]">
<xsl:sort select="DisplayOrder"/>
<xsl:sort select="Name"/>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat('c-',EntityID,'-',SEName,'.aspx')"/>
</xsl:attribute>
<xsl:value-of select="aspdnsf:GetMLValue(Name)"/>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
</PackageTransform>
</package>
2. added it to my custom ascx template for the homepage
Code:
<div class="featuredHome">
(!XmlPackage Name="rev.category.featuredhome"!)
</div>
now i will try to get the images and description for these subcategories