Developer forum

Forum » Templates » Have to catch the Groupname as headline

Have to catch the Groupname as headline


Reply
Hi,
I have a very limited knowledge of xslt template, but need to figure this out on a shop we "inherited" from another dw-partner.

Have a page showing an eCom group. Need to have the name of the group listed above the products.

This is in the productlist xslt template:


    <xsl:template name="GroupName">        <xsl:choose>            <xsl:when test="Ecom.Group.Name != ''">                <xsl:value-of select="Ecom.Group.Name" disable-output-escaping="yes"/>            </xsl:when>            <xsl:when test="loop/item[1]/Ecom.Group.Name != ''">                <xsl:value-of select="loop/item[1]/Ecom.Group.Name" disable-output-escaping="yes"/>            </xsl:when>            <xsl:otherwise>                <xsl:text>Welcome</xsl:text>            </xsl:otherwise>        </xsl:choose>    </xsl:template>

No matter what i do i just get the headline "Welcome".



Replies

 
Reply
 
Hi Morten,

Template/Ecom.Group.Name is only available when you have the GroupID parameter in the URL, like this: /Products.aspx?GroupID=GROUP1

Also, the list of groups is not available in the template unless you add the loop name (ProductGroups) to a variable called availableloops...

<xsl:variable name="availableloops" select="'ProductGroups'"></xsl:variable>


/Morten




 

You must be logged in to post in the forum