Monday 14 August 2006 3:11:52 am
Hello,
I'm building new multilanguage websites and I have some problems with language links. I have read lot of pages on this forum since I use ezpublish (3.4) and there are no real official solution provided by ez team to access a node in another language... The code I actually use is :
{let languages=hash('dut-NL','sitenl', 'eng-GB','site', 'fre-FR','sitefr') all_translations=$node.object.current.translation_list}
{let flag=hash('eng-GB', 'EN', 'fre-FR', 'FR','dut-NL', 'NL') all_translations=$node.object.current.translation_list}
{section show=$all_translations|count|gt(0)}
{section var=translation loop=$node.object.current.translation_list}
<a href={concat('http://' , $languages[$translation.item.language_code],'.url/',$DesignKeys:used.url_alias)} title={$translation.item.language_code}>{$flag[$translation.item.language_code]}</a>{delimiter} - {/delimiter}
{/section}
{/section}
{/let}{/let}
This works perfectly when view-cache is turned off... but that's not perfect because when cache is turned off, the time to load a page is >1sec .... a little bit too long, for info, when cache is turned on, this time becomes < 0.6 sec... Really better but language links deseapper from the second visit of a page... After searching and reading a lot of this forum, I think the problem is that $node is not accessible torrough pagelayout when cache is turned on... I have thus tried to use {include uri="design:language.tpl"} in my pagelayout but this doesn't change anything... Another possible solution was found at http://ez.no/community/forum/general/dissapearing_menu but I can't made an override for every node... Does anybody knows how to made a fully working language selection available on everypage when cache is turned on, but only for nodes that are translated ? I only want to see the language link when a node is translated... Otherwise the solution is easy : static links. I'm sorry if an answer exists in the forum, I can't find it....
Thanks, Yves
|