Hello, I have searched the internet and the maillinglist, but haven't found any answer. Why is it not possible to pass extra parameters to the called script with <dtml-var ...> in the following way: Example: <dtml-var some_other_dtml_method say="hello"> with some_other_dtml_method: <dtml-if say> I say: <dtml-var say> </dtml-if> O.K. there is the way: <dtml-var expr="some_other_dtml_method( _, REQUEST, say='Hello')"> But in my opinion this is unnessecary complicated, the first way would be more intuitive and it shouldn't be so complicated to implement it. So, was this discussed earlier and is there a reason for not doing it so? Andreas
Because youre making the assumption that some_other_dtml is an object that accepts parameters, rather than say a string, integer or list (for example). Dtml var is really "give me the string representation of something", rather than specifically call an object. I once heard a suggestion that dtml-var should be called dtml-print. You use parameters to that dtml var to alter that string representation. -- Andy McKay www.agmweb.ca ----- Original Message ----- From: "Andreas Brinner" <abrinner@gmx.de> To: <zope@zope.org> Sent: Saturday, October 19, 2002 11:18 AM Subject: [Zope] extra parameters in dtml-var
Hello,
I have searched the internet and the maillinglist, but haven't found any answer. Why is it not possible to pass extra parameters to the called script with <dtml-var ...> in the following way:
Example: <dtml-var some_other_dtml_method say="hello">
with some_other_dtml_method: <dtml-if say> I say: <dtml-var say> </dtml-if>
O.K. there is the way: <dtml-var expr="some_other_dtml_method( _, REQUEST, say='Hello')">
But in my opinion this is unnessecary complicated, the first way would be more intuitive and it shouldn't be so complicated to implement it.
So, was this discussed earlier and is there a reason for not doing it so?
Andreas
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I think you can do the following: <dtml-var "some_other_dtml_method(_.None, _, say='hello')"> Dirk Andy McKay schrieb:
Because youre making the assumption that some_other_dtml is an object that accepts parameters, rather than say a string, integer or list (for example). Dtml var is really "give me the string representation of something", rather than specifically call an object. I once heard a suggestion that dtml-var should be called dtml-print. You use parameters to that dtml var to alter that string representation. -- Andy McKay www.agmweb.ca
----- Original Message ----- From: "Andreas Brinner" <abrinner@gmx.de> To: <zope@zope.org> Sent: Saturday, October 19, 2002 11:18 AM Subject: [Zope] extra parameters in dtml-var
Hello,
I have searched the internet and the maillinglist, but haven't found any answer. Why is it not possible to pass extra parameters to the called script with <dtml-var ...> in the following way:
Example: <dtml-var some_other_dtml_method say="hello">
with some_other_dtml_method: <dtml-if say> I say: <dtml-var say> </dtml-if>
O.K. there is the way: <dtml-var expr="some_other_dtml_method( _, REQUEST, say='Hello')">
But in my opinion this is unnessecary complicated, the first way would be more intuitive and it shouldn't be so complicated to implement it.
So, was this discussed earlier and is there a reason for not doing it so?
Andreas
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
But wouldn't it be possible, to add additional parameters not affecting the string representation to the namespace of this object? So if the object looks up this parameter it finds it. But there is no problem, when the paramter is not used. Similar to the dtml-let tag: <dtml-let say="'hello'"> <dtml-var some_other_dtml_document> </dtml-let>
Because youre making the assumption that some_other_dtml is an object that accepts parameters, rather than say a string, integer or list (for example). Dtml var is really "give me the string representation of something", rather than specifically call an object. I once heard a suggestion that dtml-var should be called dtml-print. You use parameters to that dtml var to alter that string representation. -- Andy McKay www.agmweb.ca
----- Original Message ----- From: "Andreas Brinner" <abrinner@gmx.de> To: <zope@zope.org> Sent: Saturday, October 19, 2002 11:18 AM Subject: [Zope] extra parameters in dtml-var
Hello,
I have searched the internet and the maillinglist, but haven't found any answer. Why is it not possible to pass extra parameters to the called script with <dtml-var ...> in the following way:
Example: <dtml-var some_other_dtml_method say="hello">
with some_other_dtml_method: <dtml-if say> I say: <dtml-var say> </dtml-if>
O.K. there is the way: <dtml-var expr="some_other_dtml_method( _, REQUEST, say='Hello')">
But in my opinion this is unnessecary complicated, the first way would be more intuitive and it shouldn't be so complicated to implement it.
So, was this discussed earlier and is there a reason for not doing it so?
Andreas
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
But wouldn't it be possible, to add additional parameters not affecting the string representation to the namespace of this object? So if the object looks up this parameter it finds it. But there is no problem, when the paramter is not used.
Yes, it would be possible to add more magic to DTML and confuse the heck out of things even more. But its not for me thank you. Don't forget you can use dtml-let and dtml-with to pop stuff onto the namespace for example: DTMLMethod: testFoo <dtml-let FOOBARBINGO="'Some string'"> <dtml-var testBar> </dtml-let> DTMLMethod: testBar <dtml-var FOOBARBINGO> If you call testBar you will get a NameError, 'cos FOOBARBINGO isnt found. But if you call testFoo it prints 'Some string', testBar now has that variable in the namespace. -- Andy McKay www.agmweb.ca
Don't forget you can use dtml-let and dtml-with to pop stuff onto the namespace for example:
Oh you made that point too. So dtml-let does it explicitly and without conflict (what happens if you want to pass the size variable through and specify the dtml-var size). So whats the problem with using that? -- Andy McKay www.agmweb.ca
My problem is, that it is too complicated, in my opinion. Would it be so unlogical to add all additional paramters to the namespace? It would have already been usefull for me in some cases. Think of a template that creates some special frame around an image (for example a table with subtitle and border). I would like to call it in that way: <dtml-var my_frame image="my_image"> O.K. I could call it with dtml-let or as a python expression passing the parameter, but imho this is more confusing than extra parameters. Andreas
Don't forget you can use dtml-let and dtml-with to pop stuff onto the namespace for example:
Oh you made that point too. So dtml-let does it explicitly and without conflict (what happens if you want to pass the size variable through and specify the dtml-var size). So whats the problem with using that? -- Andy McKay www.agmweb.ca
At 08:18 PM 10/19/2002 +0200, you wrote:
I have searched the internet and the maillinglist, but haven't found any answer. Why is it not possible to pass extra parameters to the called script with <dtml-var ...> in the following way:
Perhaps for no better reason than that's not how it's done. If that really bothers you, python expressions accept parameters in the way you may be accustomed to working, eg: <dtml-var "say('hello world')"> or <dtml-call "REQUEST.set('what', 'hello world')"> <dtml-var "say(what)"> HTH Dylan
Example: <dtml-var some_other_dtml_method say="hello">
with some_other_dtml_method: <dtml-if say> I say: <dtml-var say> </dtml-if>
O.K. there is the way: <dtml-var expr="some_other_dtml_method( _, REQUEST, say='Hello')">
But in my opinion this is unnessecary complicated, the first way would be more intuitive and it shouldn't be so complicated to implement it.
So, was this discussed earlier and is there a reason for not doing it so?
Andreas
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Andreas Brinner -
Andy McKay -
Dirk Datzert -
Dylan Reinhardt