Forums / Developer / How can i write "if or and" in ezPublish?

How can i write "if or and" in ezPublish?

Author Message

Lukasz Klejnberg

Thursday 08 June 2006 4:52:41 am

Hello,

I have this simply code in eZ:
if eq( $module_result.content_info.parent_node_id, 59 )

But I don't know how can i write this code in eZ:

if (($module_result.content_info.parent_node_id == "59") OR ($module_result.content_info.parent_node_id == "123"))

Best regards,
Lukasz

Ɓukasz Serwatka

Thursday 08 June 2006 4:55:10 am

eZ publish uses template operators.

{if eq( $module_result.content_info.parent_node_id, '59' )}
    do something
{/if}

{if or( eq($module_result.content_info.parent_node_id, '59'), eq( $module_result.content_info.parent_node_id, '123'))}
    //do something
{/if}

See doc for more info and examples.

http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_operators/logical_operations

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Lukasz Klejnberg

Thursday 08 June 2006 5:07:03 am

Thanks for very fast reply :)

Best regards,
Lukasz