Finding path of an object
Hello, I now this may be a stupid question but I haven't been able to find help in the Zope docs. How do I find the path to where a specific object is located ? If i have object foo located in folder bar i want the path to look like this: /foo/bar I tried with absolute_url and getPhysicalPath ... but neither seemed to work -- Gitte Wange Jensen Sys Admin, Developer and a lot more MMmanager.org Aps, Denmark Phone: +45 29 72 79 72 Email: gitte@mmmanager.org Web: www.mmmanager.org Quote of the day: "Diskussioner ville ikke vare længe, hvis det kun var den ene part, der tog fejl."
Gitte Wange wrote:
Hello,
I now this may be a stupid question but I haven't been able to find help in the Zope docs.
How do I find the path to where a specific object is located ?
If i have object foo located in folder bar i want the path to look like this: /foo/bar
I tried with absolute_url and getPhysicalPath ... but neither seemed to work
_.string.join(getPhysicalPath(),'/') hth, -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>
I now this may be a stupid question but I haven't been able to find help in the Zope docs.
How do I find the path to where a specific object is located ?
If i have object foo located in folder bar i want the path to look like this: /foo/bar
I tried with absolute_url and getPhysicalPath ... but neither seemed to work
Why whats wrong with them? What kind of object? <dtml-var "_.string.join(getPhysicalPath(), '/')"> works fine <dtml-var absolute_url> works, but adds in the server, so you might want to hack that out, for example <dtml-var "absolute_url()[_.len(REQUEST['SERVER_URL']):]"> Cheers. -- Andy McKay.
On Wednesday 20 June 2001 18:02, you wrote:
I now this may be a stupid question but I haven't been able to find help
in
the Zope docs.
How do I find the path to where a specific object is located ?
If i have object foo located in folder bar i want the path to look like
this:
/foo/bar
I tried with absolute_url and getPhysicalPath ... but neither seemed to
work
Why whats wrong with them? What kind of object?
<dtml-var "_.string.join(getPhysicalPath(), '/')"> works fine
<dtml-var absolute_url> works, but adds in the server, so you might want to hack that out, for example <dtml-var "absolute_url()[_.len(REQUEST['SERVER_URL']):]">
I just used absolute_url(relative=1) Seems to work :-) Thanx for the help everyone .. Regards, -- Gitte Wange Jensen Sys Admin, Developer and a lot more MMmanager.org Aps, Denmark Phone: +45 29 72 79 72 Email: gitte@mmmanager.org Web: www.mmmanager.org Quote of the day: Den bedste chef er den, som har dømmekraft nok til at vælge gode mennesker til at gøre det, han selv ville have gjort, og selvbeherskelse nok til at afholde sig fra at blande sig i deres arbejde, mens de gør det. - Theodore Roosevelt
Hi Gitte, Try <dtml-var PATH_INFO> or <dtml-var PATH_TRANSLATED> Also, take a look at what <dtml-var REQUEST> gives you. It contains lots of good stuff. Eric.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Gitte Wange Sent: Wednesday, June 20, 2001 8:33 AM To: zope@zope.org Subject: [Zope] Finding path of an object
Hello,
I now this may be a stupid question but I haven't been able to find help in the Zope docs.
How do I find the path to where a specific object is located ?
If i have object foo located in folder bar i want the path to look like this: /foo/bar
I tried with absolute_url and getPhysicalPath ... but neither seemed to work
-- Gitte Wange Jensen
Sys Admin, Developer and a lot more MMmanager.org Aps, Denmark
Phone: +45 29 72 79 72 Email: gitte@mmmanager.org Web: www.mmmanager.org
Quote of the day: "Diskussioner ville ikke vare længe, hvis det kun var den ene part, der tog fejl."
_______________________________________________ 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)
-
Andy McKay -
Casey Duncan -
Eric Walstad -
Gitte Wange