Question

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>
...
Était-ce utile?

La solution

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).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top