Copied to clipboard

Flag this post as spam?

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


  • Colin Millar 7 posts 27 karma points
    May 17, 2010 @ 18:54
    Colin Millar
    0

    $currentPage on multilingual site does not reference correct site (but GetDictionaryItem works)

    Hello,

    I have a multi-lingual site set up here: http://www.streetnewsservice.org/ (English Site) with two other languages also set up. In the XSLT templates, calls to umbraco.library:GetDictionaryItem work fine. However, any references in the XSLT to $currentPage appear to reference the English version of the site only.

    Setup is as follows:

    Content
    --> English Home (associated with www.streetnewsservice.org host header, and English UK language)
    --> German Home (associated with de.streetnewsservice.org host header, and German language)
    --> Spanish Home (associated with es.streetnewsservice.org host header, and Spanish language)

    The three home pages share the same document type.

    In the templates, calls to 'umbraco.library:GetDictionaryItem("ContactUs")' work fine - the German instance of the home page outputs "KONTAKT" and the English site instance of the home page outputs "Contact Us" and so on (all correct).

    However, if I put something like <xsl:value-of select="$currentPage/@nodeName" /> in the XSLT, it ALWAYS returns "English Home" (i.e. the same of the English Home node).

    Can anyone shed any light on what I may be doing wrong here? Umbraco seems to see the correct language for the GetDictionaryItem call, but does not correctly set the currentPage XSLT variable.

    Many thanks in advance.

    Colin

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    May 17, 2010 @ 19:28
    Morten Bock
    0

    You might want to try changing a setting in the /config/umbracoSettings.config file.

    Try setting this to true:

    <useDomainPrefixes>true</useDomainPrefixes>

  • Colin Millar 7 posts 27 karma points
    May 17, 2010 @ 20:44
    Colin Millar
    0

    Thank you for your suggestion. I've changed that setting and modified the web.config to force the application to reload. Unfortunately the behaviour is unchanged. Any more suggestions much appreciated.

    Colin

  • Colin Millar 7 posts 27 karma points
    May 17, 2010 @ 22:02
    Colin Millar
    0

    OK - I've fixed it. The problem was as follows:

    1. I'd used the magic "umbracoUrlName" property to allow me to override the home page url name.
    2. I'd set the value of this to "Home" for all of the sites.
    This caused (presumably) the system to match on the value of the umbracoUrlName property, causing the value of the currentPage variable to be incorrectly set to the first website that matched (in my case, the English language one).
    So the solution was to change the property of the umbracoUrlName so as to make it unique amongst all of the three site roots.
    Thank you too, Morten, for your helpful suggestion.
    Cheers,
    Colin

Please Sign in or register to post replies

Write your reply to:

Draft