Copied to clipboard

Flag this post as spam?

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

  • Anthony Candaele 1197 posts 2049 karma points
    Feb 11, 2011 @ 16:11
    Anthony Candaele

    implementing language selector


    I have implemented the language provider as provided by Tim Geysels:

    The xslt-code for this language selector looks like this:

    <xsl:template match="/">

            <select name="langselection" onchange="loadPage(this.form.elements[0])" target="_parent._top">
                <option selected="selected">– Please select –</option>  
              <xsl:for-each select="$currentPage/ancestor::root/*">            
                  <option value="{umbraco.library:NiceUrl(@id)}">
                      <xsl:value-of select="language"/>


    The problem though with this code is that it gives me the link id for the url and not the 'alternative link'.

    This is a problem for pages from a different language node, but with the same page name.

    For instance consider this site structure

    - en
    .. software

    - nl
    .. software

    The language selector will give me no mather if I choose the English or Dutch language option.

    Therefore I need to customize the language selection code, so that the value for the language option is preceeded with hostname for the selected language, like or

    Does anyone has experience with this?

    Thanks for your help,

    Anthony Candaele

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 11, 2011 @ 19:57
    Jan Skovgaard

    Hi Anthony

    are you using a content-picker for the alternative link? In that case I guess it's simply a matter of passing the id from the alternative link to the NiceUrl and you should be good to go, right?

    Or am I missing something here?


  • Christer Josefsson 55 posts 93 karma points
    Feb 13, 2011 @ 12:28
    Christer Josefsson

    Have you set the the config property (hidetoplevelnodes?) that hides rop lever nodes to false

Please Sign in or register to post replies

Write your reply to: