eZ Community » Forums » Setup & design » Current language from block template
expandshrink

Current language from block template

Current language from block template

Monday 16 January 2012 12:32:15 pm - 3 replies

Hi all,

I struggling to figure out how to fetch current language from a block template. I can't get to  $node or $module_result, and $block doesn't seem to give enough info.

Any help is helpfull happy.gif Emoticon

Felix

Monday 16 January 2012 12:57:30 pm

Hello Felix,

 

I don't know eZ Flow well enough but does this very helpful source code snippet help you solve your issue / concern / need? The following is a way to access the global variable for $node and return the node's node_id variable content in certain template usage contexts (again I'm not certain myself, apologies).

{$#node.node_id}

From: http://share.ez.no/forums/developer/get-node-id-in-zone-template-in-ezflow#comment70088

 

I hope this helps ...

 

Cheers,

Heath

Modified on Monday 16 January 2012 12:58:55 pm by Heath

Monday 16 January 2012 1:20:14 pm

Thanks Heath! That did the trick.

Monday 16 January 2012 1:29:47 pm

You can use {ezini('RegionalSettings','Locale')} if you need the siteaccess language. The current language of the $#node does not have to be the same thing as the siteaccess language.

So it depends on what you need exactly 

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu