[Zope] Puzzling DTML method results
James W. Howe
jwh@allencreek.com
Wed, 08 Mar 2000 15:52:34 -0500
I'm encoutering a puzzling result with some DTMLMethods that I've
written. I have some code which is used to display a list of information
derived from a catalog. The information presented varies, based on which
"category" of information the user desires. The DTMLMethod which generates
most of this information looks like this:
<dtml-in "InternetLinkCatalog(meta_type='Internet Link Info',
categories=_['categoryName'])" sort=name>
<dtml-with "InternetLinkCatalog.getobject(data_record_id_)">
< ... display object stuff here ... >
</dtml-with>
</dtml-in>
For testing purposes, I created another DTMLMethod in the same folder named
'categoryName' and initially all it contained was one line:
Accounting
When I displayed the contents of my folder (which utilizes the list
generation method), I received a list of all objects which belonged to the
category of Accounting. I'm now trying to extend my code to use an actual
category name specified by a user (or from a url clicked on by the
user). I changed my 'categoryName' code to look like this:
<dtml-with REQUEST only>
<dtml-if category>
<dtml-var category>
<dtml-else>
Accounting
</dtml-if>
</dtml-with>
If I view this method, the result is 'Accounting', which is just what I
would expect. However, when I attempt to view my generated list in the
same manner as before, I get no results. I'm confused. When the
categoryName simply has the value 'Accounting' in it, I see results. If I
change the method to include some processing (but still answer the same
thing), I get no results. I'm sure that I'm just doing something stupid a,
but it's getting late in the day and I'm not seeing what the problem might
be. Can someone help explain why I'm getting two different results for
what should be the same?
Thanks.
James W. Howe mailto:jwh@allencreek.com
Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html
Ann Arbor, MI 48103