Developer forum

Forum » Templates » XSLT subsite problem

XSLT subsite problem

Victor Jonsson
Reply

Hi Dynamicweb people.

It seems that FriendlyHref doesn't recognize our subsetting. Ie. /en /de /nl

In user defined urls we've put in subsetting as myshop.com/en

The shop outputs FriendlyHref without the subsetting so the url is myshop.com/products. Where it should be myshop.com/nl/products.

See attached XSLT:

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

    <!--
  Description: ul/li based navigation. No features from admin implemented.
  Recommended settings:
  Fold out: True or False
  Upper menu: Dynamic or Static
  First level: > 0
  Last level: >= First level
  -->

    <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"  encoding="utf-8" />
    <xsl:param name="html-content-type" />
    
    <xsl:template match="/NavigationTree">
        <ul id="leftmenu" class="l1">
            <xsl:apply-templates select="Page[@ID = 6 or @ID = 40 or @ID=60 or @ID=80 or @ID=100 or @ID=120]/Page" />
        </ul>
    </xsl:template>

    <xsl:template match="Page">

        <xsl:variable name="RelativeLevel" select="'RelativeLevel '" />
        <xsl:variable name="activeitem" select="'activeitem '" />
        <xsl:variable name="inpath" select="'inpath '" />
        <xsl:variable name="toggle" select="'prMenuToggle '" />
        <xsl:variable name="classes">
            <xsl:if test="@Active='True'">
                <xsl:value-of select="$activeitem" />
            </xsl:if>
            <xsl:if test="@InPath='True'">
                <xsl:value-of select="$inpath" />
            </xsl:if>
            <xsl:if test="@ChildCount!='0'">
                <xsl:value-of select="$toggle" />
            </xsl:if>
        </xsl:variable>


        <li>
            <a>
                <xsl:attribute name="class">
                    <xsl:value-of select="normalize-space($classes)" />
                              
                  
                </xsl:attribute>
                <xsl:attribute name="href">
                   <!-- <xsl:value-of select="concat(@FriendlyHref, '&amp;Pagetitle=', @Title, '%20-%20', @MenuText, '&amp;groupname=', @MenuText)" disable-output-escaping="yes"/> -->
                  <xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/>


                </xsl:attribute>
                <xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
              
            </a>
                <xsl:if test="Page">
                <ul class="M{@AbsoluteLevel}">
                    <xsl:if test="@InPath='False'">
                        <xsl:attribute name="style">
                            <xsl:text>display:none;</xsl:text>
                        </xsl:attribute>
                    </xsl:if>
                    <xsl:apply-templates select="Page" />
                </ul>
            </xsl:if>
        </li>
  
    </xsl:template>

    <xsl:template name="generatedwtag">
        <xsl:param name="tagname" />
        <xsl:comment>
            <xsl:value-of select="concat('@', $tagname)" />
        </xsl:comment>
    </xsl:template>

</xsl:stylesheet>


Replies

 
Mikkel Ricky
Reply

What exactly are your Customized URLs settings? Are they just as the ones in the attacted image?

Best regards,
Mikkel

Screen_Shot_2014-02-06_at_14.38.17.png
 
Victor Jonsson
Reply

Hi and thanks for the quick reply Mikkel.

No, not 100%. See attached image + another image with the Modules > Websites  setting

Regards, Victor

site-url-management-center.png site-url-websites-setting.png
 
Mikkel Ricky
Reply

Ok. It seems to work for me in both Dynamicweb 8.3.1 and 8.4.0. Which version of Dynamicweb are you using?

 
Victor Jonsson
Reply

It's 8.3.1.14 (Dynamicweb Professional)

 
Mikkel Ricky
Reply

Then it should work (I've just tested it on 8.3.1.14). Do you have a solution I can take at look at? Send me an email (mri@dynamicweb.dk) if you don't want to share the solution url here.

 
Victor Jonsson
Reply

I've submitted a support case containing all info and a link to this thread.

Regards, Victor

 
Mikkel Ricky
Reply

Thanks for the support case. I'll give the answer to your case here, so that others can use the answer if they encounter the same issue.

And now for the solution: You have to make sure that the "Product page" settings (see attachtment) is pointing to the right product page (or is empty to use the page itself). On you solution it always points to the products page in the main site (page id 6).

Best regards,
Mikkel

Screen_Shot_2014-02-07_at_13.58.05.png
 
Victor Jonsson
Reply

Hi Mikkel.

That did the trick!

In my experience DW is pretty intelligent when copying sites. Updates all IDs etc. But it seems that this one didn't :)

Thanks for your help and have a nice weekend!

Regards, Victor. 

 

You must be logged in to post in the forum