[Zope] Re: YA newbie question
Hung Jung Lu
hungjunglu@hotmail.com
Wed, 07 Jun 2000 17:47:27 PDT
--- In zope@egroups.com, Randy Edwards <redwards@g...> wrote:
>...
>appropriate place in that page, do a '<dtml-var "modules.leftbuttons">' and
>have that code inserted into the page.
>
> That was my thinking. "leftbuttons" views properly by itself.
>However,
>when I try that dtml-var statment above, the page displays raw HTML.
>Obviously I'm using a wrong tactic or am not grasping a concept here.
>Anyone want to smack me (again:-) with a clue-bat? TIA.
No, I won't smack you. Newbies and Oldies alike go through this problem
again and again. It's part of the Zope Voodoo ritual that everyone has to
dance. :)
In short, use
<dtml-var "modules.leftbuttons(_.None, _)">
and see the magic before your eyes.
Now, a longer explanation. When you use "module.leftbuttons", Zope does NOT
call the leftbuttons method, intead, it tries to get its representation
string (I think.)
You will soon get used to the weirdness of DTML, and you will know that the
following three approaches
(1) <dtml-var "modules.leftbuttons">
(2) <dtml-var "modules.leftbuttons(_.None, _)">
(3) <dtml-with modules>
<dtml-var leftbuttons>
</dtml-with>
all have subtle differences that haunt Newbies and Oldies alike. If you can
tell the difference, congratulations, you've graduated from the Zope
Elementary School and understood how the namespace voodoo works. Otherwise,
keep consulting the manuals or the newsgroup. :)
Hung Jung
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com