This seems like a simple question. How do I include a Method in a different folder? I have two folders and two methods: /editor/ edit /mojo/art/ add_art_html In my file "add_art_html" I want to add this code: <dtml-var /mojo/editor/edit> But when I try to view it I get a KeyError. I also tried: <dtml-var '/mojo/editor/edit'> I tried some complicated things with <dtml-call> and <dtml-return>, but I couldn't get this to work; although, <dtml-call /editor/edit> at least did not give a KeyError. Yours, Noah
Noah wrote:
In my file "add_art_html" I want to add this code: <dtml-var /mojo/editor/edit> But when I try to view it I get a KeyError. I also tried: <dtml-var '/mojo/editor/edit'>
If Steve A's patch ever makes it into the core, you could do: &dtml-/mojo/editor/edit; ...and it'd be great if the Traversal Interface could also be used to implement: <dtml-var /mojo/editor/edit> ...but sadly, for now, you need to do: <dtml-var "PARENT[-1].mojo.editor.edit(_.None,_)"> ...or, slightly more tasty: <dtml-with "PARENT[-1].mojo.editor"> <dtml-var edit> </dtml-with> enjoy ;-) Chris
participants (2)
-
Chris Withers -
Noah