[Zope] Re: Lost in name Space...

Prateep Siamwalla teep@inet.co.th
Fri, 26 Jan 2001 18:19:40 +0700


Ok, found the answer:

<dtml-with RandomGreeting>
    <dtml-var Greet>
</dtml-with>


----- Original Message ----- 
From: Prateep Siamwalla <teep@inet.co.th>
To: <zope@zope.org>
Sent: Friday, January 26, 2001 5:55 PM
Subject: Lost in name Space...


> <<Sorry if you happen to see this for the third time, I have been trying
> to post this on egroups, but have failed on several occasions.>>
> 
> Hi,
> Zope newbie here, a bit lost on namespaces...
> 
> I have created a folder in the zope root called "RandomGreeting".  
> Inside this folder, there is one DTML METHOD called "Greet".  "Greet" 
> contains the following line:
> 
> <p><dtml-var expr="_.whrandom.choice(sayHellos)"></p>
> 
> "sayHellos" is a property of the "RandomGreeting" folder, and 
> contains 4 lines which are various ways to say 
> hello : "Ola","Hi","Bonjour","Sawasdi".  The purpose of this method
> is to print out a random greeting.
> 
> Everytime i click "View" for this DTML Method, i get a random hello.  
> Fine, that is exactly what I want.
> 
> The problem is that I am trying to use this "method" from its parent 
> folder (the root folder as a matter of fact).  I have inserted the 
> following bit into the top level "index_html" DTML Method of my Zope 
> root near the begining, so that it produces a random hello on the 
> front page everytime someone accesses it.
> 
> I have tried :
> <dtml-var RandomGreeting.Greet>
> <dtml-var RandomGreeting.Greet()>
> <dtml-var "RandomGreeting.Greet()">
> <dtml-var /RandomGreeting/Greet>
> 
> all of these, to know avail.  I am getting either a NameError or 
> KeyError.  I am pretty sure I'm missing a simple concept here. It is 
> possible to call functions from child objects is it not? 
> 
> Please help with some enlightenment.  Many thanks in advance.
> 
> teep
> 
> 
> 
> 
> 
> 
>