[Zope] Advanced DTML Question
Evan Simpson
evan@4-am.com
Thu, 2 Mar 2000 11:15:34 -0600
----- Original Message -----
From: James W. Howe <jwh@allencreek.com>
> I've tried to do something like you suggested, but it doesn't seem to
> work. I'm probably not doing things quite correctly. I've added a
> "getAnchorCharacter" method to my ZClass which correctly answers the
> character I want to use as an anchor. I've tested this and know that it
> works. I tried using "<dtml-if sequence-first-getAnchorCharacter> ...",
> but got no result. Could you explain a bit more about how something like
> "sequence-first-xxx" works? I haven't found any information on this form
> of a dtml-in variable. Perhaps I'm just misunderstanding your solution.
Check the Grouping Variables subsection of
http://www.zope.org/Documentation/Guides/DTML-HTML/DTML.8.html
I did give you the wrong syntax; it's <dtml-if first-getAnchorCharacter>,
with no "sequence-".
> In thinking about this solution, it seems that if I'm inside of a dtml-in
> iterating over entries in a Catalog, the objects known to the "dtml-in"
> aren't instances of my ZClass, but instances of some catalogging wrapper
> for my ZClass. Therefore, it would seem that my getAnchorCharacter method
> wouldn't be accessible from within the dtml-in, but only from within a
> dtml-with which sets the object to be the object referenced by the catalog
> entry.
I misunderstood you. The catalog wrapper is the "brain" which needs to have
the getAnchorCharacter method. But... Suppose you add getAnchorCharacter as
a catalogued meta_type in your Catalog? I think that would work.
Cheers,
Evan @ 4-am & digicool