In DTML is it possible to get an object using its url? Something like <dtml-with "get_object( '/some/local/url' )">...</dtml-with> Similar to <dtml-with "_.getitem( name )">...</dtml-with> but what I have is the object's zserver url, not its name in the current namespace. TIA, Scott
On Wed, 16 Aug 2000, Scott Shepherd wrote:
In DTML is it possible to get an object using its url? Something like
<dtml-with "get_object( '/some/local/url' )">...</dtml-with>
Something like. I asked this question a long time ago, and refound the answer by searching the zope.nipltd.com mailing list archives using the search terms 'resolve and url'. <dtml-with "REQUEST.resolve_url('/some/local/url')"> I also have a vauge memory that this may be a depricated interface and that 2.2 has some new method you should use instead. But I couldn't come up with a search phrase to get the right message for that one <frown>. --RDM
<dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')"> ----- Original Message ----- From: "Scott Shepherd" <skot@pobox.com> To: <zope@zope.org> Sent: Wednesday, August 16, 2000 5:06 AM Subject: [Zope] DTML: fetch an object by its url?
In DTML is it possible to get an object using its url? Something like
<dtml-with "get_object( '/some/local/url' )">...</dtml-with>
Similar to
<dtml-with "_.getitem( name )">...</dtml-with>
but what I have is the object's zserver url, not its name in the current namespace.
TIA, Scott
_______________________________________________ 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 )
Phil Harris wrote:
<dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')">
Shame no-one implemented this into the entity syntax :( &dtml-/some/folder/and/path/wotsit; would be so nice ;-) cheers, Chris PS: I wonder if that'd make a good little dev.zope.org project?
What's the difference between: <dtml-with "_.string.split(URL,'/')[-2]"> (for current folder) or <dtml-with "_.string.split(URL,'/')[-1]"> (for current object) and
<dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')"> ??
----- Original Message ----- From: "Scott Shepherd" <skot@pobox.com> To: <zope@zope.org> Sent: Wednesday, August 16, 2000 5:06 AM Subject: [Zope] DTML: fetch an object by its url?
In DTML is it possible to get an object using its url? Something like
<dtml-with "get_object( '/some/local/url' )">...</dtml-with>
Similar to
<dtml-with "_.getitem( name )">...</dtml-with>
but what I have is the object's zserver url, not its name in the current namespace.
TIA, Scott
_______________________________________________ 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 )
Acquisition ----- Original Message ----- From: "Peter Bengtsson" <peter@grenna.net> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Wednesday, August 16, 2000 10:03 AM Subject: Re: [Zope] DTML: fetch an object by its url?
What's the difference between: <dtml-with "_.string.split(URL,'/')[-2]"> (for current folder) or <dtml-with "_.string.split(URL,'/')[-1]"> (for current object)
and
<dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')"> ??
----- Original Message ----- From: "Scott Shepherd" <skot@pobox.com> To: <zope@zope.org> Sent: Wednesday, August 16, 2000 5:06 AM Subject: [Zope] DTML: fetch an object by its url?
In DTML is it possible to get an object using its url? Something like
<dtml-with "get_object( '/some/local/url' )">...</dtml-with>
Similar to
<dtml-with "_.getitem( name )">...</dtml-with>
but what I have is the object's zserver url, not its name in the current namespace.
TIA, Scott
_______________________________________________ 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 )
_______________________________________________ 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 )
Hi, I don't know why, but <dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')"> doesn't work in my zope installation (2.2.2) well, <dtml-var "REQUEST.resolve_url(REQUEST.BASE0+'/some/folder/and/path/wotsit')"> works. Maybe it is because that zope want to get ready for RPC. Iap, Singuan ----- Original Message ----- From: "Phil Harris" <phil.harris@zope.co.uk> To: <zope@zope.org>; "Scott Shepherd" <skot@pobox.com> Sent: Wednesday, August 16, 2000 3:57 PM Subject: Re: [Zope] DTML: fetch an object by its url?
<dtml-var "REQUEST.resolve_url('/some/folder/and/path/wotsit')">
----- Original Message ----- From: "Scott Shepherd" <skot@pobox.com> To: <zope@zope.org> Sent: Wednesday, August 16, 2000 5:06 AM Subject: [Zope] DTML: fetch an object by its url?
In DTML is it possible to get an object using its url? Something like
<dtml-with "get_object( '/some/local/url' )">...</dtml-with>
Similar to
<dtml-with "_.getitem( name )">...</dtml-with>
but what I have is the object's zserver url, not its name in the current namespace.
TIA, Scott
_______________________________________________ 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 )
participants (6)
-
Chris Withers -
iap_y2fun.com -
Peter Bengtsson -
Phil Harris -
R. David Murray -
Scott Shepherd