[Zope] dtml-with question
Laurie Nason
laurien@tiger.bcm.tmc.edu
Wed, 16 May 2001 11:03:37 -0500
You beauty!!! This worked a treat - thanks so much - now I can get back to
what I am supposed to be doing!!
Laurie
-----Original Message-----
From: David Hassalevris [mailto:bluepaul@earthlink.net]
Sent: Tuesday, May 15, 2001 7:56 PM
To: Laurie Nason
Subject: Re: [Zope] dtml-with question
Laurie,
If you havent tried something like this, give it a shot.
It may work :-0
#2--------------------------------
<dtml-with name="lookups">
<dtml-with "_.getitem(lookuptype)">
<add dtml method here>
</dtml-with>
</dtml-with>
David
Laurie Nason wrote:
>
> Nope - doesn't sort the problem out. Maybe I didn't explain myself too
well
> on the first attempt. What I am trying to do in the code is to add a dtml
> method in the folder of my choice - see code below....
> I call the method below with a lookuptype which is the name of one of the
> folders - it is then supposed to find the folder and create a new method
in
> that folder. Like I said before - the first piece of code works as it
should
> and creates my new method in the correct folder, but the second one
doesn't
> put the requested folder on the top of the namespace (or doesn't appear
to)
> it creates the new method in the lookups folder.
>
> My folders look like:
> lookups
> |-->strain
> |-->species
> |-->etc...
>
> #1--------------------------------
> <dtml-with name="lookups">
> <dtml-with name="strain">
> <add dtml method here (this bit works!)>
> </dtml-with>
> </dtml-with>
>
> #2--------------------------------
> <dtml-with name="lookups">
> <dtml-with name=lookuptype>
> <add dtml method here (this bit works!)>
> </dtml-with>
> </dtml-with>
>
> Any ideas..?
> Laurie
>
> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of David
> Brown
> Sent: Tuesday, May 15, 2001 11:33 AM
> To: Laurie Nason; Zope
> Subject: Re: [Zope] dtml-with question
>
> The problem is that
>
> > <dtml-with name=lookuptype>
>
> isn't really what you want -- you're telling dtml-var that the name is
> lookuptype, when what you really mean is that you want the value of
> lookuptype.
>
> It's probably more complex than this, but try:
>
> <dtml-var expr="lookuptype">
>
> The quotes are not controlling evaluation, like you think they are. Inf
> act, by the time it gets to the dtml-var evaluation code, Zope has no clue
> whether or not you have quoted it or not.
>
> dave
>
> _______________________________________________
> 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 )