Ethan, thanks for the mail. Methods and documents are becoming clearer...but at the same time I keep finding that I almost want to be able to switch modes within the same page. So for some parts of a page/layout (whatever you want to call it), I want it to act as a 'pseudopod of a folder', and then later on, (for instance to get standard_html_header to work like I want) I want the same page/layout to work in the document 'mode'. Manipulating namespaces and contexts is currently not a trivial matter which I am frankly finding very confusing (yet powerful at the same time). cheers, Darcy Ethan Fremen wrote:
Darcy Clark wrote:
Janko,
thanks for explaining this....it works for me also. Although I must admit that I am still suprised that I cannot get this to work somehow if index_html is a method.
Think of methods as a pseudopod of a folder, not a entity unto itself. They're best used for DTML code that has at least folder-wide scope, in my experience. I try to push as much presentation logic into methods as I can, and use DTML documents as content objects.
The reason I am trying to use methods is that in my standard_html_header I am also using the <!--#tree--> tag - this tag only seems to work properly if index_html is a method. I guess I still don't appreciate the finer points of methods/documents and acquisition.
<dtml-tree expr="PARENTS[0]">
will make a tree starting from the folder above the DTML Document.
<dtml-if "meta_type == 'DTML Document> <dtml-tree expr="PARENTS[0]"></dtml-tree> <dtml-else "meta_type == 'DTML Method'> <dtml-tree expr="PARENTS[1]"></dtml-tree> </dtml-if>
might be what you're looking for. Feel free to add branch_expr etc.
-- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology.
-- --------------------------------------------------- Ph: (734) 764 3377 Email: darcyc@engin.umich.edu URL: http://www-personal.engin.umich.edu/~darcyc/ --------------------------------------------------- 'If you're not part of the solution, you're part of the precipitate' ..... Steven Wright