[ZPT] Composer question

Jean Jordaan jean@upfrontsystems.co.za
Fri, 13 Dec 2002 12:35:10 +0200


> In the following, Composer discards the <span ..> tags::
> 
>   <select name="Country">
>     <span tal:repeat="country_item here/interface/country_list">
>     <option value=""
>             tal:define="selected python:(feko_user.Country == count 
> ry_item and 'selected') or ''"
>             tal:attributes="value country_item; selected selected"
>             tal:content="country_item">country_name
>     </option>
>     </span>
>   </select>

So far, I've found that Composer throws away SPAN, DIV and B
tags. It preserves <!-- comments -->. But now I can't figure
out how to do a tal:repeat with a tal:define inside it so that
the page remains editable using Composer. The tal:define needs
to go inside the tal:repeat, because it uses the iteration item.
Putting the tal:repeat on the SELECT generates many SELECTs.
Putting the tal:repeat on the OPTION evaluates the tal:define
before the repeat.

The only way I could figure out to make this work, is::

   <select name="Country">
     <option value=""
             tal:repeat="country_item here/interface/country_list"
             tal:attributes="value country_item; selected 
python:(feko_user.Country == country_item and 'selected') or ''"
             tal:content="country_item">country_name
     </option>
   </select>

I.e. discard the tal:define.

-- 
Jean Jordaan
http://www.upfrontsystems.co.za