Sorry - resend: verifying existence
Greetings, I am trying to figure out how a page can tell if it exists or is displayed using acquisition. For example, say /index_html exists, but /services/index_html, and /products/index_html do not. If a user goes to the url, http://www.mysite.com/services I want to do something like: <dtml-with "currentDirectory.aq_explicit" only> <dtml-if "thisPage exists"> do something </dtml-if> Thanks, Steve
On Fri, Jan 04, 2002 at 06:23:08AM -0600, Steven Turoff wrote:
<dtml-if "thisPage exists">
<dtml-if "_.hasattr('thisPage')"> Oleg. -- Oleg Broytmann http://phd.pp.ru/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
At 07:50 AM 01/04/2002, Oleg Broytmann wrote:
On Fri, Jan 04, 2002 at 06:23:08AM -0600, Steven Turoff wrote:
<dtml-if "thisPage exists">
<dtml-if "_.hasattr('thisPage')">'
I'm still confused as to how I obtain thisPage. For example, the following files and folders exist: /index_html /services/ If I go to the URL www.mysite.com/services/index_html, I will be shown /index_html because of acquisition. If I use the above advice, I get <dtml-if "_.hasattr('index_html')">. However, if I was on a page such as /services/foo_html, the code would be <dtml-if "_.hasattr('foo_html')">. So, the question is, how do I get the name of the document being requested? Thanks, steve
On Fri, Jan 04, 2002 at 04:53:17PM -0600, Steven Turoff wrote:
I'm still confused as to how I obtain thisPage. For example, the following files and folders exist:
/index_html /services/
If I go to the URL www.mysite.com/services/index_html, I will be shown /index_html because of acquisition. If I use the above advice, I get <dtml-if "_.hasattr('index_html')">. However, if I was on a page such as /services/foo_html, the code would be <dtml-if "_.hasattr('foo_html')">. So, the question is, how do I get the name of the document being requested?
You are doing something strange. You re trying to get the name of *the* document and then verify if *the* document exists. I don't understand this. If *the* document is being rendered why do you need to verify its existance? Of course it exists - beccuse it is being rendered now! Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Is "REQUEST.PUBLISHED.id" what you want? Iap, Singuan ----- Original Message ----- From: "Oleg Broytmann" <phd@phd.pp.ru> To: <zope@zope.org> Sent: Saturday, January 05, 2002 8:15 PM Subject: Re: [Zope] verifying existence
On Fri, Jan 04, 2002 at 04:53:17PM -0600, Steven Turoff wrote:
I'm still confused as to how I obtain thisPage. For example, the following files and folders exist:
/index_html /services/
If I go to the URL www.mysite.com/services/index_html, I will be shown /index_html because of acquisition. If I use the above advice, I get <dtml-if "_.hasattr('index_html')">. However, if I was on a page such as /services/foo_html, the code would be <dtml-if "_.hasattr('foo_html')">. So, the question is, how do I get the name of the document being requested?
You are doing something strange. You re trying to get the name of *the* document and then verify if *the* document exists. I don't understand this. If *the* document is being rendered why do you need to verify its existance? Of course it exists - beccuse it is being rendered now!
Oleg. -- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
_______________________________________________ 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 (3)
-
iap@y2fun.com -
Oleg Broytmann -
Steven Turoff