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

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

eZ debug

Timing: Jan 31 2025 06:08:49
Script start
Timing: Jan 31 2025 06:08:50
Module start 'layout'
Timing: Jan 31 2025 06:08:50
Module start 'content'
Timing: Jan 31 2025 06:08:50
Module end 'content'
Timing: Jan 31 2025 06:08:50
Script end

Main resources:

Total runtime0.0339 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.2500151.2266
Module start 'layout' 0.00520.0031 739.476636.6641
Module start 'content' 0.00820.0242 776.140690.2969
Module end 'content' 0.03250.0014 866.437533.9922
Script end 0.0338  900.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00247.1431140.0002
Check MTime0.00113.1876140.0001
Mysql Total
Database connection0.00071.969310.0007
Mysqli_queries0.00308.818130.0010
Looping result0.00000.044310.0000
Template Total0.00102.910.0010
Template load0.00072.125510.0007
Template processing0.00030.797410.0003
Override
Cache load0.00051.532210.0005
General
dbfile0.011433.613780.0014
String conversion0.00000.023940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs