Using a DTML Method to render a DTMLDocument?
Ok, here's what I'm trying to do, let's say I have a bunch of DTMLDocuments that I want to be able to call various different DTMLMethod renderer's on. A poor example would be, a DTMLMethod that adds a header and footer to a DTMLDocument that doesn't have one. For example : MyDocument (DTMLDocument): <H1> Hello World </H1> -------------------------- MyMethod (DTMLMethod): <H1> MY HEADER </H1> <dtml-var this> <H1> MY FOOTER </H1> --------------------------- So when I call http://localhost/MyDocument/MyMethod I get back : MY HEADER Hello World MY FOOTER So far, so good. The problem is, when MyDocument has dtml in it, it does not render that dtml. For example if : MyDocument (DTMLDocument): <H1> Hello World </H1> <dtml-var someotherpage> --------------------------- When I call http://localhost/MyDocument/MyMethod I get back MY HEADER Hello World <dtml-var someotherpage> MY FOOTER So I actually see the dtml tag rather than the content of someotherpage. Is there away to do this in DTML? I have figured out a way to do it with an ExternalMethod (by manually calling HTML.__call__ on it). But I wonder if there is an easier way. Thanks, Cayce __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com
Cayce Ullman wrote:
Ok, here's what I'm trying to do, let's say I have a bunch of DTMLDocuments that I want to be able to call various different DTMLMethod renderer's on. A poor example would be, a DTMLMethod that adds a header and footer to a DTMLDocument that doesn't have one.
Might I suggest a header and footer method that's called by the document? I do this in my standard_html_header: <dtml-if localheader><dtml-var localheader></dtml-if> The same in the footer works. This way, whatever localheader is in the aquisition path gets rendered. If you can't rely on aquisition, I think you need some namespace magic. Try <dtml-var _[someotherpage]> in your DTMLDocument without header/footer. *if* this works, then it'll break if the DTML document isn't rendered this way. -- Ethan "mindlace" Fremen you cannot abdicate responsibility for your ideology.
participants (2)
-
Cayce Ullman -
Ethan Fremen