Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon steed 376 posts 688 karma points
    Apr 19, 2011 @ 22:01
    Simon steed
    0

    Big problem with navigation on multilingual site - strange redirection happening

    Hi,

    I've got a site that was initially just in English but is now German as well. The DE part is yet to go live but the UK is still running.

    Previously the structure for the site was:

    Content

    Home

    product

    solution

    help

     

    Now it's:

    Content

    Home

    product

    solution

    help

    Haus

    German product

    German solution

    German help

     

    Obviously the only difference is the addition of the German node which was cloned from UK Home. I'm using hostname redirection and that is working okey dokey, however not 100%.

    What is happening now is that the top menu nav is being generated via XSLT (see code below) and when the user clicks upon the link, some strange redirection is happening so instead of seeing:

    http://www.site.com/product they are getting redirected to http://www.site.com/home/product which is messing things up. 

    However, if you type in http://www.site.com/product, you do go to the correct page and it all renders fine, just gets redirected and adds the /home to the url - WHY?

    Menu code:

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
              <li>
              <!-- Add the class selected if the currentpage or parent nodes (up the tree to the root) ID matches our current node ID in the for each loop-->
              <xsl:if test="$currentPage/ancestor-or-self::* [@isDoc]/@id = current()/@id">
                <xsl:attribute name="class">
                  <xsl:text>selected</xsl:text>
                </xsl:attribute>
              </xsl:if>
                
                <a>
                <xsl:attribute name="href">
                  /<xsl:value-of select="@urlName" />
                </xsl:attribute>
                  <xsl:value-of select="@nodeName" />
                </a>            
                <!-- this does the same, commented out so you can see both approaches
                <a href="{umbraco.library:NiceUrl(@id)}">
                <xsl:value-of select="@nodeName" />
              </a>-->
                
                
            </li>
          </xsl:for-each>

    Can anyone suggest what is going on here and how I can resolve it?

    Cheers

    Si

  • Simon steed 376 posts 688 karma points
    Apr 21, 2011 @ 18:14
    Simon steed
    0

    Anyone?

  • Berto 105 posts 177 karma points
    Apr 21, 2011 @ 19:39
    Berto
    1

    Do you have the appSetting umbracoHideTopLevelNodeFromPath in the web.config set to true?

  • Simon steed 376 posts 688 karma points
    Apr 21, 2011 @ 19:58
    Simon steed
    0

    Spot on - It was set to false, now i've set to true it's now working, thanks big time Berto :-)

  • Berto 105 posts 177 karma points
    Apr 21, 2011 @ 21:02
    Berto
    0

    Glad i could help ;)

Please Sign in or register to post replies

Write your reply to:

Draft