Tuesday 30 October 2007 6:52:39 pm
I had the following simple code for a language switcher on a 3.9 site that I just upgraded to 3.10:
<div id="language-switcher">
<a href="{concat('http://www.example.org/', $DesignKeys:used.url_alias)}">English</a> |
<a href="{concat('http://es.example.org/', $DesignKeys:used.url_alias)}">Español</a> |
<a href="{concat('http://fr.example.org/', $DesignKeys:used.url_alias)}">Français</a>
</div>
Which used to produce, e.g.:
<div id="language-switcher">
<a href="{concat('http://www.example.org/contact">English</a> |
<a href="{concat('http://es.example.org/contact">Español</a> |
<a href="{concat('http://fr.example.org/contact">Français</a>
</div>
This now produces (on the English site):
<div id="language-switcher">
<a href="{concat('http://www.example.org/Contact">English</a> |
<a href="{concat('http://es.example.org/Contact">Español</a> |
<a href="{concat('http://fr.example.org/Contact">Français</a>
</div>
Which of course does not work, because the url_alias on the English site is different to the aliases for the other language sites. What it needs to produce is this:
<div id="language-switcher">
<a href="{concat('http://www.example.org/Contact">English</a> |
<a href="{concat('http://es.example.org/Contactarnos">Español</a> |
<a href="{concat('http://fr.example.org/Contactez_Nous">Français</a>
</div>
However, I can't work out any way to extract the other languages' url_alias from ezpublish. I've done this as a temporary fix, but it's not ideal:
<div id="language-switcher">
<a href="{concat('http://www.example.org/', $uri_string)}">English</a> |
<a href="{concat('http://es.example.org/', $uri_string)}">Español</a> |
<a href="{concat('http://fr.example.org/', $uri_string)}">Français</a>
</div>
From looking at the 3.9 webin extension it seems to me this problem would affect the language switcher there too. I can't seem to find a 3.10 webin though to compare. Any ideas?
Thanks Matthew
http://carroll.org.uk
|