3

Is there an alternative to what I do below :

...
<div class="abc" tal:condition="this/condition1">
    <div class="abc2" tal:condition="this/condition2">
    ...
    </div>
</div>
...

Such as :

...
<div class="abc" tal:condition="this/condition1 AND this/condition2">
...
</div>
...
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Pumpkin
  • 1,993
  • 3
  • 26
  • 32

1 Answers1

5

It's a bit silly, but there's no logical AND in TALES.

You can use php: prefix:

<div tal:condition="php:this.condition1 AND this['condition2']">

but keep in mind that with php: you need to use type-dependent syntax (. for objects, [] for arrays, because / becomes division).

Kornel
  • 97,764
  • 37
  • 219
  • 309