How does "and" works? cond(and($current_node....

Author Message

Guilherme Longo

Tuesday 04 September 2007 6:17:16 am

Finishing my question for today, i've aready tryed find in ez Forum and web but i didnt find how that operator works:

$current_node_in_path = cond(<b>and<b>($current_node_id, ........

I would like to know how does <b>and<b> works

André R.

Tuesday 04 September 2007 8:54:56 am

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

Example:

{if and( is_set( $node ), $node.node_id|eq( 2 )  )}
  You are on the root node<br />
{/if}

in php code that would be something like:

if ( isset( $node ) && $node->attribute('node_id') == 2  )
{
  echo 'You are on the root node<br />';
}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Olivier Ouin

Tuesday 04 September 2007 9:36:31 am

Like most of eZ templates operator, you have two way to use it.

Let say we have 2 booleans $cond1 and $cond2.

You can test that these 2 booleans are not false with :

    {if and($cond1, $cond2)} ok {/if}

or

    {if $cond1|and($cond2)} ok {/if}

It's up to you.

Guilherme Longo

Wednesday 05 September 2007 2:19:37 am

hum, ok!

basicly, if i want test more than 1 condition in "once time" I need to use "and" logical operator!!

That's fine.

Thank so much!

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 20 2025 03:59:40
Script start
Timing: Jan 20 2025 03:59:40
Module start 'layout'
Timing: Jan 20 2025 03:59:40
Module start 'content'
Timing: Jan 20 2025 03:59:40
Module end 'content'
Timing: Jan 20 2025 03:59:40
Script end

Main resources:

Total runtime0.0201 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.0046 589.2891152.6406
Module start 'layout' 0.00460.0040 741.929739.4766
Module start 'content' 0.00860.0094 781.406389.3984
Module end 'content' 0.01800.0021 870.804734.3047
Script end 0.0201  905.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002613.0547140.0002
Check MTime0.00126.0578140.0001
Mysql Total
Database connection0.00062.887110.0006
Mysqli_queries0.002311.382030.0008
Looping result0.00000.074810.0000
Template Total0.00168.110.0016
Template load0.00094.640410.0009
Template processing0.00073.460410.0007
Override
Cache load0.00063.037810.0006
General
dbfile0.003015.126280.0004
String conversion0.00000.034440.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.0001 secs