Hi,

Am Dienstag, den 28.04.2009, 12:41 +0100 schrieb Kornel Lesiński:
> On 28-04-2009 at 11:45:43 Julian Haupt <julian.ha...@hauptmedia.de> wrote:
> 
> > <tal:block tal:repeat="c categories">
> >     <option tal:attributes="value c/id; selected condition: c.active|
> > string:selected|not:true" tal:content="c/category"></option>
> > </tal:block>
> 
> This is unnecessary.
> 
> If boolean value is available in the model, you don't need such modifier at 
> all:

> PHPTAL recognizes attributes like checked/selected/readonly and translates 
> boolean value to appropriate value automatically.

Oh, i was not aware of this behaviour.

The introduced condition keyword becomes useful when css class
considerations come into place, as you can write the template like this:

<span class="audio current" tal:attributes="class string:audio
${condition:Controller/active_category/isAudio|string:current|
string:sep}"/>

(CSS Class is current when the category is active and sep otherwise)


Grettings,

Julian Haupt

-- 
Julian Haupt B.Sc.

Hauptmedia
Landgraf-Georg-Str. 25
64283 Darmstadt

fon:   +49 6151 - 278 041 7
fax:   +49 6151 - 278 041 8
mobil: +49  179 - 901 548 7
email: julian.ha...@hauptmedia.de
web:   www.hauptmedia.de

St.-Nr. 007/825/32605


_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to