Hi there, I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both: <!--#var PARENTS[1]--> and <!--#expr PARENTS[1]--> How do I do this? Also, is it possible to nest calls? I.E. How can I make: <!--#var <!--#var id--><!--#var_another_method--> --> or similar In other words how can I make a compound call based on path (or other) variables? Thanx in advance. Chris
Hi Chris Have you tried <dtml-var "PARENTS[1]"> Might work ;¬) Phil phil@philh.org -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 29 September 1999 22:27 To: zope@zope.org Subject: [Zope] Newbie PARENTS question Hi there, I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both: <!--#var PARENTS[1]--> and <!--#expr PARENTS[1]--> How do I do this? Also, is it possible to nest calls? I.E. How can I make: <!--#var <!--#var id--><!--#var_another_method--> --> or similar In other words how can I make a compound call based on path (or other) variables? Thanx in advance. Chris _______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (Related lists - please, no cross posts or HTML encoding! To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Thanx Phil, but that substitution is giving me "<Folder instance at 8577a18>" not the id of the parent folder... any ideas? Phil Harris wrote:
Hi Chris
Have you tried
<dtml-var "PARENTS[1]">
Might work ;¬)
Phil phil@philh.org
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 29 September 1999 22:27 To: zope@zope.org Subject: [Zope] Newbie PARENTS question
Hi there,
I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both:
<!--#var PARENTS[1]--> and <!--#expr PARENTS[1]-->
How do I do this?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx in advance.
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
How about (untested) <dtml-var "PARENTS[1].id"> Phil -----Original Message----- From: Chris Cooke-Johnson [mailto:chriscj@gocarib.com] Sent: 30 September 1999 00:03 To: Phil Harris Cc: zope@zope.org Subject: Newbie PARENTS question - <Folder instance at 8577a18> Thanx Phil, but that substitution is giving me "<Folder instance at 8577a18>" not the id of the parent folder... any ideas? Phil Harris wrote:
Hi Chris
Have you tried
<dtml-var "PARENTS[1]">
Might work ;¬)
Phil phil@philh.org
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 29 September 1999 22:27 To: zope@zope.org Subject: [Zope] Newbie PARENTS question
Hi there,
I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both:
<!--#var PARENTS[1]--> and <!--#expr PARENTS[1]-->
How do I do this?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx in advance.
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Great Phil - that worked perfectly :-) Any thought on my nesting question?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx again and in advance, Chris Phil Harris wrote:
How about (untested)
<dtml-var "PARENTS[1].id">
Phil
-----Original Message----- From: Chris Cooke-Johnson [mailto:chriscj@gocarib.com] Sent: 30 September 1999 00:03 To: Phil Harris Cc: zope@zope.org Subject: Newbie PARENTS question - <Folder instance at 8577a18>
Thanx Phil,
but that substitution is giving me "<Folder instance at 8577a18>" not the id of the parent folder...
any ideas?
Phil Harris wrote:
Hi Chris
Have you tried
<dtml-var "PARENTS[1]">
Might work ;¬)
Phil phil@philh.org
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 29 September 1999 22:27 To: zope@zope.org Subject: [Zope] Newbie PARENTS question
Hi there,
I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both:
<!--#var PARENTS[1]--> and <!--#expr PARENTS[1]-->
How do I do this?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx in advance.
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Explain exactly what you want in a bit more detail, I'm not sure I understand what's going on. -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 30 September 1999 00:25 To: Phil Harris Cc: zope@zope.org Subject: [Zope] Re: PARENTS solved - nesting question Great Phil - that worked perfectly :-) Any thought on my nesting question?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx again and in advance, Chris Phil Harris wrote:
How about (untested)
<dtml-var "PARENTS[1].id">
Phil
-----Original Message----- From: Chris Cooke-Johnson [mailto:chriscj@gocarib.com] Sent: 30 September 1999 00:03 To: Phil Harris Cc: zope@zope.org Subject: Newbie PARENTS question - <Folder instance at 8577a18>
Thanx Phil,
but that substitution is giving me "<Folder instance at 8577a18>" not the id of the parent folder...
any ideas?
Phil Harris wrote:
Hi Chris
Have you tried
<dtml-var "PARENTS[1]">
Might work ;¬)
Phil phil@philh.org
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 29 September 1999 22:27 To: zope@zope.org Subject: [Zope] Newbie PARENTS question
Hi there,
I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both:
<!--#var PARENTS[1]--> and <!--#expr PARENTS[1]-->
How do I do this?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx in advance.
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (Related lists - please, no cross posts or HTML encoding! To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Phil, This is a pretty heavy request by some standards - some database front ends will handle it and some won't - I'm new to zope so I'm not sure if it will, but the rest of zope seems very well thought out so I'd like to think there is a way to do this. What I want is a nested call/substitution. This often requires a second pass through the parsing routine, or in other packages a special syntax. The exact example I'm working on is as follows. I've got a series or sectional news folders, each folder has a DTML doc which contains the content and a DTML method as the index_html which is substituting another DTML method which references the content file. Basically, I've got one DTML method in the parent directory, which is being used by all the index_html DTML methods in the sub folders. my first attempt at the code was: <dtml-var <dtml-var id>_content> So if the active dir is "general" then I'd end up with <dtml-var general_content> Which would be in turn replaced by the DTML document. This way the one master DTML method can be used through all of the sections. I hope I've managed to clear it up a bit. Thanx Chris Phil Harris wrote:
Explain exactly what you want in a bit more detail, I'm not sure I understand what's going on.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 30 September 1999 00:25 To: Phil Harris Cc: zope@zope.org Subject: [Zope] Re: PARENTS solved - nesting question
Great Phil - that worked perfectly :-)
Any thought on my nesting question?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx again and in advance,
Chris
Phil Harris wrote:
How about (untested)
<dtml-var "PARENTS[1].id">
Phil
-----Original Message----- From: Chris Cooke-Johnson [mailto:chriscj@gocarib.com] Sent: 30 September 1999 00:03 To: Phil Harris Cc: zope@zope.org Subject: Newbie PARENTS question - <Folder instance at 8577a18>
Thanx Phil,
but that substitution is giving me "<Folder instance at 8577a18>" not the id of the parent folder...
any ideas?
Phil Harris wrote:
Hi Chris
Have you tried
<dtml-var "PARENTS[1]">
Might work ;¬)
Phil phil@philh.org
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chris Cooke-Johnson Sent: 29 September 1999 22:27 To: zope@zope.org Subject: [Zope] Newbie PARENTS question
Hi there,
I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both:
<!--#var PARENTS[1]--> and <!--#expr PARENTS[1]-->
How do I do this?
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Thanx in advance.
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(Related lists - please, no cross posts or HTML encoding!
To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Others can correct me if I'm wrong, but the Zope way would not be to a structure like the following: /news/ /general/ /general_content /index_html /sports/ /sports_content /index_html /weather/ /weather_content /index_html but rather to have /news/ /content /index_html /general/ /content /sports/ /content /weather/ /content In index_html you would do: <dtml-var content> and when the user's browser uses: .../news/index_html the aquisition will replace <dtml-var content> with the content object in the /news/ folder, when the browser uses the URL: .../news/general/index_html then acquisition will replace <dtml-var content> with the content object found in /news/general/ and so on... Alternately you can iterate over folders: <dtml-with news> <dtml-in "objectItems(['Folder'])"> <dtml-var content> </dtml-in> </dtml-with> Where, through the magic of acquisition within the dtml-in contruct, the <dtml-var content> gives you the contents of each folders 'content' object. I think... Cheers... Bruce Chris Cooke-Johnson wrote:
I've got a series or sectional news folders, each folder has a DTML doc which contains the content and a DTML method as the index_html which is substituting another DTML method which references the content file. Basically, I've got one DTML method in the parent directory, which is being used by all the index_html DTML methods in the sub folders.
my first attempt at the code was:
<dtml-var <dtml-var id>_content>
So if the active dir is "general" then I'd end up with
<dtml-var general_content>
Which would be in turn replaced by the DTML document.
This way the one master DTML method can be used through all of the sections.
I hope I've managed to clear it up a bit.
Thanx Chris
-- Bruce Elrick, Ph.D. Saltus Technology Consulting Group Cell: (403) 870-4429 Personal: belrick@home.com IBM Certified Specialist Business: belrick@saltus.ab.ca ADSM, AIX Support, RS/6000 SP, HACMP
I have a Zclass (planner) with an instance (plan). Planner has a Zclass that is based on Zcatalog aware and object manager called planner_wish. The DTML method that creates instances of planner_wish uses <dtml-call reindex_object> to (I wish) get the item into the catalog like so: <!--#with "myclass.createInObjectManager(REQUEST['id'], REQUEST)"--> <dtml-call "propertysheets.myclass.manage_editProperties(REQUEST)"> <dtml-call reindex_object> <!--#/with--> I've defined a default_catalog for the parent Zclass, but I can't seem to get the items to catalog into any catalog except "Catalog". Is there a way to change the name of the default catalog? Josh ___________________________________________ Joshua Brauer joshua@brauer.org http://www.brauer.org ___________________________________________
Joshua Brauer wrote:
I have a Zclass (planner) with an instance (plan).
Planner has a Zclass that is based on Zcatalog aware and object manager called planner_wish.
The DTML method that creates instances of planner_wish uses <dtml-call reindex_object> to (I wish) get the item into the catalog like so:
<!--#with "myclass.createInObjectManager(REQUEST['id'], REQUEST)"--> <dtml-call "propertysheets.myclass.manage_editProperties(REQUEST)"> <dtml-call reindex_object> <!--#/with-->
I've defined a default_catalog for the parent Zclass, but I can't seem to get the items to catalog into any catalog except "Catalog". Is there a way to change the name of the default catalog?
No. CatalogAware is a hack. I will be greatly improving it's interface soon, unless someone else wants to take a clever stab at it. -Michel
At 05:27 PM 9/29/99 -0400, Chris Cooke-Johnson wrote:
I'm trying to reference the folder above from a DTML method. Basically what I'm looking for is an equivalent to the the <!--#var id--> which will give the id of the parent folder. In the DTML reference I found an explanation of the PARENTS attribute with seems to be what I want but I'm getting errors with both:
<!--#var PARENTS[1]--> and <!--#expr PARENTS[1]-->
These are not legal DTML. To insert an expression you need to do this <!--#var expr="PARENTS[1]"--> or for short, <!--#var "PARENTS[1]"--> Check the DTML User's Guide for more details. http://www.zope.org/Documentation/Guides/DTML_doc Also the Advanced DTML How-To has lots of good info on variable expressions, and other goodies. http://www.zope.org/Documentation/How-To/AdvancedDTML
Also, is it possible to nest calls? I.E. How can I make:
<!--#var <!--#var id--><!--#var_another_method--> --> or similar
In other words how can I make a compound call based on path (or other) variables?
Hmm. I don't quite understand this question. Perhaps you want to do something like so, <!--#var expr="PARENTS[1].someMethod()"--> In general in an DTML expression you can write most kind of valid python expression. Good luck! -Amos
participants (8)
-
Amos Latteier -
Bruce Elrick -
Chris Cooke-Johnson -
Ethan Fremen -
Joshua Brauer -
Michel Pelletier -
Pavlos Christoforou -
Phil Harris