Forums / Setup & design / {if $module_result.content_info.node_id|eq( '2' )}

{if $module_result.content_info.node_id|eq( '2' )}

Author Message

Patryk Kala

Sunday 04 March 2007 8:32:03 am

{if $module_result.content_info.node_id|eq( '2' )}

lol

{else}
{/if}

why this dose't work ??

Coulibaly Ibrahim

Monday 05 March 2007 2:38:07 am

You must be sure that this variable is available in every tempate.
it's available in PageLayout and its overrides, but it's available in the other templates?
i don't know about it but try to verify it. it can perhaps help you.

Patryk Kala

Monday 05 March 2007 8:12:37 am

What i have to do in another templates??

Marko Žmak

Monday 05 March 2007 2:39:42 pm

The $module_result variable is of course also available in the templates you include from pagelayout.

What you have to do in other templates depens on what your really WANT to do. Do you really need to use this code in all the templates or only in pagelayout?

For example if you want to get the current node id in nodeview you can use:

$node.node_id

On the other hand in the template that overrides user/login you cannot get the current node id since there's no node you are viewing there.

For further information about $module_result see:

http://ez.no/doc/ez_publish/technical_manual/3_6/templates/the_pagelayout/variables_in_pagelayout#module_result

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth