Concaténation de 2 variables

9 messages Options
Embed this post
Permalink
Benjamin Klups

Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
Je souhaite concaténer 2 variables dans un tal:content
voici mon code :
<select name="max_area:int"
                              id="max_area"
                              tabindex=""
                              tal:define="realestate_properties portal_properties/realestatebroker_properties;"
                              tal:attributes="tabindex tabindex/next;">
                        <option value="0" tal:attributes="selected python: not ('min_area' in request.form)" i18n:translate="area_no_limit"> No Limit </option>
                       
                          <option tal:attributes="selected python: ('max_area' in request.form) and (int(request.form['max_area']) == int(area)); value area" tal:content="area string: $var2">
                          </option>
                       

                      </select>

mes 2 variables sont donc area et var2
en gros j'ai une surface à laquelle je veux concaténer m2 (en variable ou en chaîne de caractère)
je sais bien que tal:content="area string: $var2" ne peut pas fonctionner tel quel mais je suis un peu perdu
Merci de vos conseils
Thomas Desvenain-2

Re: Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
et ça ? :

tal:content="string:$area $var2"


2009/3/9 Benjamin Klups <[hidden email]>:

>
> Je souhaite concaténer 2 variables dans un tal:content
> voici mon code :
> <select name="max_area:int"
>                              id="max_area"
>                              tabindex=""
>                              tal:define="realestate_properties
> portal_properties/realestatebroker_properties;"
>                              tal:attributes="tabindex tabindex/next;">
>                        <option value="0" tal:attributes="selected python:
> not ('min_area' in request.form)" i18n:translate="area_no_limit"> No Limit
> </option>
>
>                          <option tal:attributes="selected python:
> ('max_area' in request.form) and (int(request.form['max_area']) ==
> int(area)); value area" tal:content="area string: $var2">
>                          </option>
>
>                      </select>
>
> mes 2 variables sont donc area et var2
> en gros j'ai une surface à laquelle je veux concaténer m2 (en variable ou en
> chaîne de caractère)
> je sais bien que tal:content="area string: $var2" ne peut pas fonctionner
> tel quel mais je suis un peu perdu
> Merci de vos conseils
> --
> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2450427.html
> Sent from the Plone - France mailing list archive at Nabble.com.
>
>
>
> _______________________________________________
> Plone-FR mailing list
> [hidden email]
> http://lists.plone.org/mailman/listinfo/plone-fr
>
>



--
Thomas DESVENAIN - Développeur
INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage
92210 Saint Cloud - France
Phone : 01 78 15 24 06 / Fax : 01 46 02 44 04
http://www.ingeniweb.com - une société du groupe Alter Way
--

_______________________________________________
Plone-FR mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-fr
Benjamin Klups

Re: Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
python:area+'m2'

fonctionne bien

merci

Thomas Desvenain-2

Re: Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
"string:$area m2" est mieux. tu n'as pas besoin de caster area en string.
c'est également plus lisible. je te conseille d'éviter les directives
python autant que possible

2009/3/11 Benjamin Klups <[hidden email]>:

>
> python:area+'m2'
>
> fonctionne bien
>
> merci
>
>
> --
> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2463218.html
> Sent from the Plone - France mailing list archive at Nabble.com.
>
>
>
> _______________________________________________
> Plone-FR mailing list
> [hidden email]
> http://lists.plone.org/mailman/listinfo/plone-fr
>
>



--
Thomas DESVENAIN - Développeur
INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage
92210 Saint Cloud - France
Phone : 01 78 15 24 06 / Fax : 01 46 02 44 04
http://www.ingeniweb.com - une société du groupe Alter Way
--

_______________________________________________
Plone-FR mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-fr
Benjamin Klups

Re: [Plone-FR] Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Si j'utilise : string:$area m2 
comment puis je traduire mon m2 en m² avec i18n, quelle syntaxe ?


mon code :
 < span tal:omit-tag="" tal:repeat="area realestate_properties/min_area" >
                          < option  tal:attributes="selected python: ('min_area' in request.form) and (int(request.form['min_area']) == int(area)); value area" tal:content="string:$area m2" >
                          < /option >
                        < /span >


------
Benjamin Klups
NOVELTYS 

Le 12 mars 09 à 09:46, Thomas Desvenain-2 (via Nabble) a écrit :

"string:$area m2" est mieux. tu n'as pas besoin de caster area en string.
c'est également plus lisible. je te conseille d'éviter les directives
python autant que possible

2009/3/11 Benjamin Klups <benjamin.klups@...>:

>
> python:area+'m2'
>
> fonctionne bien
>
> merci
>
>
> --
> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2463218.html
> Sent from the Plone - France mailing list archive at Nabble.com.
>
>
>
> _______________________________________________
> Plone-FR mailing list
> Plone-FR@...
> http://lists.plone.org/mailman/listinfo/plone-fr
>
>



--
Thomas DESVENAIN - Développeur
INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage
92210 Saint Cloud - France
Phone : 01 78 15 24 06 / Fax : 01 46 02 44 04
http://www.ingeniweb.com - une société du groupe Alter Way
--

_______________________________________________
Plone-FR mailing list
Plone-FR@...
http://lists.plone.org/mailman/listinfo/plone-fr

Gilles Lenfant

Re: Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
L'entité ² doit être supportée par la plupart des navigateurs de  
nos jours.

http://www.w3schools.com/tags/ref_entities.asp

Le 13 mai 09 à 12:10, Benjamin Klups a écrit :

>
> Si j'utilise : string:$area m2
> comment puis je traduire mon m2 en m² avec i18n, quelle syntaxe ?
>
>
> mon code :
>  < span tal:omit-tag="" tal:repeat="area realestate_properties/
> min_area" >
>                           < option  tal:attributes="selected python:
> ('min_area' in request.form) and (int(request.form['min_area']) ==
> int(area)); value area" tal:content="string:$area m2" >
>                           < /option >
>                         < /span >
>
>
> ------
> Benjamin Klups
> NOVELTYS
> www.noveltys.fr
>
> Le 12 mars 09 à 09:46, Thomas Desvenain-2 (via Nabble) a écrit :
>
>> "string:$area m2" est mieux. tu n'as pas besoin de caster area en
>> string.
>> c'est également plus lisible. je te conseille d'éviter les directives
>> python autant que possible
>>
>> 2009/3/11 Benjamin Klups <benjamin.klups@...>:
>>
>>>
>>> python:area+'m2'
>>>
>>> fonctionne bien
>>>
>>> merci
>>>
>>>
>>> --
>>> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2463218.html
>>> Sent from the Plone - France mailing list archive at Nabble.com.
>>>
>>>
>>>
>>> _______________________________________________
>>> Plone-FR mailing list
>>> Plone-FR@...
>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>>
>>>
>>
>>
>>
>> --
>> Thomas DESVENAIN - Développeur
>> INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
>> Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage
>> 92210 Saint Cloud - France
>> Phone : 01 78 15 24 06 / Fax : 01 46 02 44 04
>> http://www.ingeniweb.com - une société du groupe Alter Way
>> --
>>
>> _______________________________________________
>> Plone-FR mailing list
>> Plone-FR@...
>> http://lists.plone.org/mailman/listinfo/plone-fr
>>
>>
>> This email is a reply to your post @ http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2466174.html
>> You can reply by email or by visting the link above.
>>
>
>
> --
> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2881420.html
> Sent from the Plone - France mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Plone-FR mailing list
> [hidden email]
> http://lists.plone.org/mailman/listinfo/plone-fr


_______________________________________________
Plone-FR mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-fr
Benjamin Klups

Re: Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
si je mets tal:content="string:$area m²"
j'obtiendrais m² en affichage

------
Benjamin Klups
NOVELTYS
www.noveltys.fr

Le 13 mai 09 à 12:20, Gilles Lenfant a écrit :

> L'entité ² doit être supportée par la plupart des navigateurs  
> de nos jours.
>
> http://www.w3schools.com/tags/ref_entities.asp
>
> Le 13 mai 09 à 12:10, Benjamin Klups a écrit :
>
>>
>> Si j'utilise : string:$area m2
>> comment puis je traduire mon m2 en m² avec i18n, quelle syntaxe ?
>>
>>
>> mon code :
>> < span tal:omit-tag="" tal:repeat="area realestate_properties/
>> min_area" >
>>                          < option  tal:attributes="selected python:
>> ('min_area' in request.form) and (int(request.form['min_area']) ==
>> int(area)); value area" tal:content="string:$area m2" >
>>                          < /option >
>>                        < /span >
>>
>>
>> ------
>> Benjamin Klups
>> NOVELTYS
>> www.noveltys.fr
>>
>> Le 12 mars 09 à 09:46, Thomas Desvenain-2 (via Nabble) a écrit :
>>
>>> "string:$area m2" est mieux. tu n'as pas besoin de caster area en
>>> string.
>>> c'est également plus lisible. je te conseille d'éviter les  
>>> directives
>>> python autant que possible
>>>
>>> 2009/3/11 Benjamin Klups <benjamin.klups@...>:
>>>
>>>>
>>>> python:area+'m2'
>>>>
>>>> fonctionne bien
>>>>
>>>> merci
>>>>
>>>>
>>>> --
>>>> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2463218.html
>>>> Sent from the Plone - France mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Plone-FR mailing list
>>>> Plone-FR@...
>>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Thomas DESVENAIN - Développeur
>>> INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
>>> Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage
>>> 92210 Saint Cloud - France
>>> Phone : 01 78 15 24 06 / Fax : 01 46 02 44 04
>>> http://www.ingeniweb.com - une société du groupe Alter Way
>>> --
>>>
>>> _______________________________________________
>>> Plone-FR mailing list
>>> Plone-FR@...
>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>>
>>>
>>> This email is a reply to your post @ http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2466174.html
>>> You can reply by email or by visting the link above.
>>>
>>
>>
>> --
>> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2881420.html
>> Sent from the Plone - France mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> Plone-FR mailing list
>> [hidden email]
>> http://lists.plone.org/mailman/listinfo/plone-fr
>



_______________________________________________
Plone-FR mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-fr
Gilles Lenfant

Re: Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
Salut,

Il suffit de regarder le source HTML généré pour voir où se trouve  
l'erreur : TAL quote les chaînes de caractères dans les expressions  
"string:..."

Donc, utiliser :

tal:content="structure string:$area m²"

http://docs.zope.org/zope2/zope2book/source/AdvZPT.html#inserting-structure

A lire entièrement...

++
--
Gilles Lenfant

Le 13 mai 09 à 14:17, Benjamin Klups a écrit :

> si je mets tal:content="string:$area m²"
> j'obtiendrais m² en affichage
>
> ------
> Benjamin Klups
> NOVELTYS
> www.noveltys.fr
>
> Le 13 mai 09 à 12:20, Gilles Lenfant a écrit :
>
>> L'entité ² doit être supportée par la plupart des navigateurs  
>> de nos jours.
>>
>> http://www.w3schools.com/tags/ref_entities.asp
>>
>> Le 13 mai 09 à 12:10, Benjamin Klups a écrit :
>>
>>>
>>> Si j'utilise : string:$area m2
>>> comment puis je traduire mon m2 en m² avec i18n, quelle syntaxe ?
>>>
>>>
>>> mon code :
>>> < span tal:omit-tag="" tal:repeat="area realestate_properties/
>>> min_area" >
>>>                         < option  tal:attributes="selected python:
>>> ('min_area' in request.form) and (int(request.form['min_area']) ==
>>> int(area)); value area" tal:content="string:$area m2" >
>>>                         < /option >
>>>                       < /span >
>>>
>>>
>>> ------
>>> Benjamin Klups
>>> NOVELTYS
>>> www.noveltys.fr
>>>
>>> Le 12 mars 09 à 09:46, Thomas Desvenain-2 (via Nabble) a écrit :
>>>
>>>> "string:$area m2" est mieux. tu n'as pas besoin de caster area en
>>>> string.
>>>> c'est également plus lisible. je te conseille d'éviter les  
>>>> directives
>>>> python autant que possible
>>>>
>>>> 2009/3/11 Benjamin Klups <benjamin.klups@...>:
>>>>
>>>>>
>>>>> python:area+'m2'
>>>>>
>>>>> fonctionne bien
>>>>>
>>>>> merci
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2463218.html
>>>>> Sent from the Plone - France mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Plone-FR mailing list
>>>>> Plone-FR@...
>>>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thomas DESVENAIN - Développeur
>>>> INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
>>>> Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage
>>>> 92210 Saint Cloud - France
>>>> Phone : 01 78 15 24 06 / Fax : 01 46 02 44 04
>>>> http://www.ingeniweb.com - une société du groupe Alter Way
>>>> --
>>>>
>>>> _______________________________________________
>>>> Plone-FR mailing list
>>>> Plone-FR@...
>>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>>>
>>>>
>>>> This email is a reply to your post @ http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2466174.html
>>>> You can reply by email or by visting the link above.
>>>>
>>>
>>>
>>> --
>>> View this message in context: http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2881420.html
>>> Sent from the Plone - France mailing list archive at Nabble.com.
>>>
>>>
>>> _______________________________________________
>>> Plone-FR mailing list
>>> [hidden email]
>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>
>
>


_______________________________________________
Plone-FR mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-fr
Thomas Desvenain-2

Re: Concaténation de 2 variables

Reply Threaded More More options
Print post
Permalink
In reply to this post by Benjamin Klups
essaye

tal:content="structure string:$area m²"

structure empêche l'échappement des entités et caractères spéciaux (<,
>) du html

2009/5/13 Benjamin Klups <[hidden email]>:

> si je mets tal:content="string:$area m²"
> j'obtiendrais m² en affichage
>
> ------
> Benjamin Klups
> NOVELTYS
> www.noveltys.fr
>
> Le 13 mai 09 à 12:20, Gilles Lenfant a écrit :
>
>> L'entité ² doit être supportée par la plupart des navigateurs de nos
>> jours.
>>
>> http://www.w3schools.com/tags/ref_entities.asp
>>
>> Le 13 mai 09 à 12:10, Benjamin Klups a écrit :
>>
>>>
>>> Si j'utilise : string:$area m2
>>> comment puis je traduire mon m2 en m² avec i18n, quelle syntaxe ?
>>>
>>>
>>> mon code :
>>> < span tal:omit-tag="" tal:repeat="area realestate_properties/
>>> min_area" >
>>>                         < option  tal:attributes="selected python:
>>> ('min_area' in request.form) and (int(request.form['min_area']) ==
>>> int(area)); value area" tal:content="string:$area m2" >
>>>                         < /option >
>>>                       < /span >
>>>
>>>
>>> ------
>>> Benjamin Klups
>>> NOVELTYS
>>> www.noveltys.fr
>>>
>>> Le 12 mars 09 à 09:46, Thomas Desvenain-2 (via Nabble) a écrit :
>>>
>>>> "string:$area m2" est mieux. tu n'as pas besoin de caster area en
>>>> string.
>>>> c'est également plus lisible. je te conseille d'éviter les directives
>>>> python autant que possible
>>>>
>>>> 2009/3/11 Benjamin Klups <benjamin.klups@...>:
>>>>
>>>>>
>>>>> python:area+'m2'
>>>>>
>>>>> fonctionne bien
>>>>>
>>>>> merci
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2463218.html
>>>>> Sent from the Plone - France mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Plone-FR mailing list
>>>>> Plone-FR@...
>>>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thomas DESVENAIN - Développeur
>>>> INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
>>>> Bureaux de la Colline - 1 rue Royal - Bâtiment D - 9ème étage
>>>> 92210 Saint Cloud - France
>>>> Phone : 01 78 15 24 06 / Fax : 01 46 02 44 04
>>>> http://www.ingeniweb.com - une société du groupe Alter Way
>>>> --
>>>>
>>>> _______________________________________________
>>>> Plone-FR mailing list
>>>> Plone-FR@...
>>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>>>
>>>>
>>>> This email is a reply to your post @
>>>> http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2466174.html
>>>> You can reply by email or by visting the link above.
>>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://n2.nabble.com/Concat%C3%A9nation-de-2-variables-tp2450427p2881420.html
>>> Sent from the Plone - France mailing list archive at Nabble.com.
>>>
>>>
>>> _______________________________________________
>>> Plone-FR mailing list
>>> [hidden email]
>>> http://lists.plone.org/mailman/listinfo/plone-fr
>>
>
>
>
> _______________________________________________
> Plone-FR mailing list
> [hidden email]
> http://lists.plone.org/mailman/listinfo/plone-fr
>



--

Thomas DESVENAIN - Développeur
Ingeniweb, Alterway Solutions
1, rue Royale
227, Les Bureaux de la Colline - Bat D
92213  - Saint Cloud Cedex
Tél : 01 78 15 24 00 / Fax : 01 46 02 44 04
http://www.ingeniweb.com
--

_______________________________________________
Plone-FR mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-fr