Developer forum

Forum » Ecommerce - Standard features » eCom groups in navigation

eCom groups in navigation

Martin Christensen
Reply

Hey,

I'm having trouble displaying my eCom product groups in the navigation. I've attached a screenshot of my navigaion-setup as seen on the primary shop page.

I'm currently using the following navigation template:

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

  <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"  encoding="utf-8" />
  <xsl:param name="html-content-type" />
  <xsl:template match="/NavigationTree">

    <xsl:if test="count(//Page/Page[contains(@Href, 'GroupID')]) > 0">
      <ul class="M0">
        <xsl:apply-templates select="Page/Page[contains(@Href, 'GroupID')]">
          <xsl:with-param name="depth" select="1"/>
        </xsl:apply-templates>
      </ul>
    </xsl:if>
    
  </xsl:template>

  <xsl:template match="//Page">
    <xsl:param name="depth"/>
      <li class="{@class}">
      <a class="{@class}">
    
        <xsl:attribute name="href">
          <xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/>
        </xsl:attribute>
        <xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
      </a>
      <xsl:if test="count(Page) and @InPath='True'">
        <ul class="M{@AbsoluteLevel}">
          <xsl:apply-templates select="Page">
            <xsl:with-param name="depth" select="$depth+1"/>
          </xsl:apply-templates>
        </ul>
      </xsl:if>
    </li>
  </xsl:template>

</xsl:stylesheet>

The xpath selection fails, which isn't too surprising considering that none of my eCom product groups are included in the xml being generated from Management Center > Designer > Navigations XML

Thanks in advance :)

(translated for future reference)

Skærmbillede_2015-04-24_kl._12.19.28.png

Replies

 
Nicolai Høeg Pedersen
Reply

Hi Martin

In English please.

On your website settings under ecommerce dialog, make sure you set a language - and make sure the groups you have is translated.

On the page, run the URL with ?savexml=true - that will save a file with the actual XML next to your XSLT file. Then you can see the data and find problems in your XSLT if any.

Br Nicolai

 
Martin Christensen
Reply

Hi,

Thanks for the input! I changed the website settings as advised, and my groups appear to be translated.

Still, none of the product group elements show up in the xml saved on the server.

 

 
Nicolai Høeg Pedersen
Reply

Hi Martin

Then we need a link to see what can be wrong...

BR Nicolai

 
Martin Christensen
Reply

Nicolai gave me the solution to this:

The main webshop page was hidden in the menu, since it was still undergoing development. This caused the product groups to be ommitted from the navigation xml. So I simply published it, and everything worked like a charm.

Thanks again!

 

You must be logged in to post in the forum