Forums / Setup & design / Best way to get current language?

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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