Best way to get current language?

Author Message

Kai Duebbert

Sunday 28 September 2003 2:33:10 am

Hi,

What's the best way to get the current language? If I use $node, then it only works *before* caching. If I use $module_result.content_into.language, then it only works *after* it has been cached. Do I really have to test which one is set?

What's the best solution?

Thanks,
Kai

Kai Duebbert

Sunday 28 September 2003 7:08:20 pm

I'm using this at the moment, in case anyone is interested or has a better solution:

{let language=false()}
{section show=is_set($module_result.content_info.language)}
{set language=$module_result.content_info.language}
{section-else}
{set language=$node.object.default_language}
{/section}
[...]
{/let}

Vivienne van Velzen

Monday 29 September 2003 11:21:51 pm

Hi Kai,

It's not the solution to your problem, but it does explain when to use $node and when $module_result. Maybe it'll help.

http://www.ez.no/developer/ez_publish_3/forum/setup_design/node_module_result_designkeys_question

Greetings,

Vivienne

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.