[Zope] More Calling Dtml-Methods with variable names
Jeremiah White
miah34@msn.com
Fri, 22 Jun 2001 22:30:06 -0500
------=_NextPart_001_0000_01C0FB6A.E3418140
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
OK, I have a small problem now.
This is my main DTML document1:
<dtml-var standard_html_header>
<dtml-var expr=3D"_.getitem(someMethod,1)">
<p> That's all. </p>
<dtml-var standard_html_footer>
Let's say the variable someMethod holds the string 'Method1'.
The DTML Method 'Method1' holds this:
<h1> HELLO </h1>
This actually outputs what you would expect:
'header stuff'
HELLO (bold)
That's all.
'footer stuff'
But what if Method1 is not in the same folder? For example, if it's in t=
he folder 'Methods' which is in the folder that the main document is in. =
I can't seem to get that to work. I've tried this:
<dtml-var expr=3D"_.getitem('Methods.'+someMethod,1)">
and I've tried changing the variable name to 'Methods.Method1', but each =
of these gives me an error:
This resource may be trying to reference a nonexistent object or variable=
Methods.Method1. =20
Using Methods.Method1() does not make a difference.
If I just put in <dtml-var expr=3D"Methods.Method1()"> it works. Not wh=
at I want though.
Thanks for you time reading through this message. I'm really just experi=
menting with Zope right now, trying to learn what it can do and how it ac=
complishes those things. I have a feeling some experienced Zope users ar=
e laughing hysterically at some of the things I'm doing!
-JeremiahGet more from the Web. FREE MSN Explorer download : http://expl=
orer.msn.com
------=_NextPart_001_0000_01C0FB6A.E3418140
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<HTML><BODY STYLE=3D"font:10pt verdana; border:none;"><DIV> OK, I ha=
ve a small problem now.</DIV> <DIV> </DIV> <DIV>This is my main DTML=
document1:</DIV> <DIV> </DIV> <DIV><dtml-var standard_html_heade=
r></DIV> <DIV><dtml-var expr=3D"_.getitem(someMethod,1)"></DIV> =
<DIV><p> That's all. </p></DIV> <DIV><dtml-var standard_ht=
ml_footer></DIV> <DIV> </DIV> <DIV> </DIV> <DIV>Let's say th=
e variable someMethod holds the string 'Method1'.</DIV> <DIV> </DIV>=
<DIV>The DTML Method 'Method1' holds this:</DIV> <DIV> </DIV> <DIV>=
<h1> HELLO </h1></DIV> <DIV> </DIV> <DIV> </DIV> <D=
IV>This actually outputs what you would expect:</DIV> <DIV> </DIV> <=
DIV>'header stuff'</DIV> <DIV>HELLO (bold)</DIV> <DIV>That's all.</DIV> <=
DIV>'footer stuff'</DIV> <DIV> </DIV> <DIV>But what if Method1 is no=
t in the same folder? For example, if it's in the folder 'Methods' =
which is in the folder that the main document is in. I can't seem t=
o get that to work. I've tried this:</DIV> <DIV> </DIV> <DIV>&=
lt;dtml-var expr=3D"_.getitem('Methods.'+someMethod,1)"></DIV> <DIV>&n=
bsp;</DIV> <DIV>and I've tried changing the variable name to 'Method=
s.Method1', but each of these gives me an error:</DIV> <DIV> </=
DIV> <DIV> <LI>This resource may be trying to reference a nonexistent obj=
ect or variable <STRONG>Methods.Method1</STRONG>. </LI></DIV> <DIV> =
</DIV> <DIV>Using Methods.Method1() does not make a difference.</DIV> <DI=
V> </DIV> <DIV>If I just put in <dtml-var expr=3D"Methods.Method1=
()"> it works. Not what I want though.</DIV> <DIV> </=
DIV> <DIV>Thanks for you time reading through this message. I'm rea=
lly just experimenting with Zope right now, trying to learn what it can d=
o and how it accomplishes those things. I have a feeling some exper=
ienced Zope users are laughing hysterically at some of the things I'm doi=
ng!</DIV> <DIV> </DIV> <DIV>-Jeremiah</DIV> <DIV> </DIV> <DIV>&=
nbsp;</DIV> <DIV> </DIV></BODY></HTML><br clear=3Dall><hr>Get more f=
rom the Web. FREE MSN Explorer download : <a href=3D'http://explorer.msn=
.com'>http://explorer.msn.com</a><br></p>
------=_NextPart_001_0000_01C0FB6A.E3418140--