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 www.mysite.com/software.aspx 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 www.mysite.com/en/software.aspx or www.mysite.com/nl/software.aspx
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?
implementing language selector
Hi,
I have implemented the language provider as provided by Tim Geysels:
http://www.nibble.be/?p=32
The xslt-code for this language selector looks like this:
<xsl:template match="/">
<form>
<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"/>
</option>
</xsl:for-each>
</select>
</form>
</xsl:template>
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 www.mysite.com/software.aspx 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 www.mysite.com/en/software.aspx or www.mysite.com/nl/software.aspx
Does anyone has experience with this?
Thanks for your help,
Anthony Candaele
Belgium
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?
/Jan
Have you set the the config property (hidetoplevelnodes?) that hides rop lever nodes to false
is working on a reply...