DTML parameter to Python script
Hi, In the following DTML document I am trying to give the parameter 'dtml-sequence-item''to the setDirectory python script. This parameter doesn't return the right value. Instead it returns '<&dtml-sequence-item>'. What have I done wrong ? <dtml-in "admin.objectIds('Local Directory')"> <img src="/misc_/OFSP/Folder_icon.gif"> <a href=<dtml-var expr="setDirectory('<&dtml-sequence-item>')">> <dtml-var sequence-item></a> <br> </dtml-in> Regards. Michael
On Thu, 2003-10-02 at 07:26, Michael Bleijerveld wrote:
Hi,
In the following DTML document I am trying to give the parameter 'dtml-sequence-item''to the setDirectory python script. This parameter doesn't return the right value. Instead it returns '<&dtml-sequence-item>'.
Instead of: '<&dtml-sequence-item>' try: '&dtml-sequence-item;' HTH, Dylan
I got the same result. Michael ----- Original Message ----- From: "Dylan Reinhardt" <zope@dylanreinhardt.com> To: "Michael Bleijerveld" <michael@bleijerveld.nl> Cc: "Zope Users" <zope@zope.org> Sent: Thursday, October 02, 2003 5:29 PM Subject: Re: [Zope] DTML parameter to Python script
On Thu, 2003-10-02 at 07:26, Michael Bleijerveld wrote:
Hi,
In the following DTML document I am trying to give the parameter 'dtml-sequence-item''to the setDirectory python script. This parameter doesn't return the right value. Instead it returns '<&dtml-sequence-item>'.
Instead of:
'<&dtml-sequence-item>'
try:
'&dtml-sequence-item;'
HTH,
Dylan
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Hi <dtml-in "admin.objectIds('Local Directory')"> <img src="/misc_/OFSP/Folder_icon.gif"> <a href=<dtml-var expr="setDirectory('<&dtml-sequence-item>')">> <dtml-var sequence-item></a> <br> </dtml-in> in a python expression you cannot have dtml tags !!! instead, write like this: .. expr="setDirectory(_['sequence-item']) ... Dragos ----- Original Message ----- From: "Michael Bleijerveld" <michael@bleijerveld.nl> To: <zope@zope.org> Sent: Thursday, October 02, 2003 5:46 PM Subject: Re: [Zope] DTML parameter to Python script
I got the same result.
Michael
----- Original Message ----- From: "Dylan Reinhardt" <zope@dylanreinhardt.com> To: "Michael Bleijerveld" <michael@bleijerveld.nl> Cc: "Zope Users" <zope@zope.org> Sent: Thursday, October 02, 2003 5:29 PM Subject: Re: [Zope] DTML parameter to Python script
On Thu, 2003-10-02 at 07:26, Michael Bleijerveld wrote:
Hi,
In the following DTML document I am trying to give the parameter 'dtml-sequence-item''to the setDirectory python script. This parameter doesn't return the right value. Instead it returns '<&dtml-sequence-item>'.
Instead of:
'<&dtml-sequence-item>'
try:
'&dtml-sequence-item;'
HTH,
Dylan
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Thu, 2003-10-02 at 09:55, Dragos Chirila wrote:
Hi
<dtml-in "admin.objectIds('Local Directory')"> <img src="/misc_/OFSP/Folder_icon.gif"> <a href=<dtml-var expr="setDirectory('<&dtml-sequence-item>')">> <dtml-var sequence-item></a> <br> </dtml-in>
in a python expression you cannot have dtml tags !!!
Ah, good catch... not sure why I didn't notice what this was being passed to.
instead, write like this: .. expr="setDirectory(_['sequence-item']) ...
Better yet, use the prefix attribute of dtml-in: <dtml-in "admin.objectIds('Local Directory')" prefix=obj> <img src="/misc_/OFSP/Folder_icon.gif"> <a href=<dtml-var expr="setDirectory(obj_item)">> <dtml-var obj_item></a> <br> </dtml-in> Dylan
Hi Dylan, The result of the link is always the last link. Regards. Michael ----- Original Message ----- From: "Dylan Reinhardt" <zope@dylanreinhardt.com> To: "Dragos Chirila" <d.chirila@bucarest.finsiel.ro> Cc: "Zope Users" <zope@zope.org> Sent: Thursday, October 02, 2003 7:12 PM Subject: Re: [Zope] DTML parameter to Python script
On Thu, 2003-10-02 at 09:55, Dragos Chirila wrote:
Hi
<dtml-in "admin.objectIds('Local Directory')"> <img src="/misc_/OFSP/Folder_icon.gif"> <a href=<dtml-var expr="setDirectory('<&dtml-sequence-item>')">> <dtml-var sequence-item></a> <br> </dtml-in>
in a python expression you cannot have dtml tags !!!
Ah, good catch... not sure why I didn't notice what this was being passed to.
instead, write like this: .. expr="setDirectory(_['sequence-item']) ...
Better yet, use the prefix attribute of dtml-in:
<dtml-in "admin.objectIds('Local Directory')" prefix=obj> <img src="/misc_/OFSP/Folder_icon.gif"> <a href=<dtml-var expr="setDirectory(obj_item)">> <dtml-var obj_item></a> <br> </dtml-in>
Dylan
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Michael Bleijerveld wrote at 2003-10-2 16:26 +0200:
In the following DTML document I am trying to give the parameter 'dtml-sequence-item''to the setDirectory python script. This parameter doesn't return the right value. Instead it returns '<&dtml-sequence-item>'.
What have I done wrong ?
<dtml-in "admin.objectIds('Local Directory')"> <img src="/misc_/OFSP/Folder_icon.gif"> <a href=<dtml-var expr="setDirectory('<&dtml-sequence-item>')">> <dtml-var sequence-item></a> <br> </dtml-in>
Do not nest "dtml" constructs such as "&dtml-XXX;" inside "dtml-var". Read the Zope Book about the "prefix" attribute to "dtml-in". Dieter
participants (4)
-
Dieter Maurer -
Dragos Chirila -
Dylan Reinhardt -
Michael Bleijerveld