From: Santtu P. <ja...@pa...> - 2004-06-12 00:10:12
|
Oops. I noticed a little flaw in my templates. Writing the post at 3:00 AM, I somehow assumed Spyce would export all context variables into the local namespace like the PHP template engine does, but after a quick RTFM I noticed it doesn't. Here're the corrected versions of my example templates, ham.tpl.spi and spam.tpl.spi: I have spam.tpl.spi (the inner template, .tpl.spi to indicate it's a template) with the following content: [[.import name=include ]] <!-- Begin spam.tpl.spi --> <h1>[[=include.context['title'] ]]</h1> [[=include.context['content'] ]] <!-- End spam.tpl.spi --> I have ham.tpl.spi (the outer template) with the following content: [[.import name=include ]] <!-- Begin ham.tpl.spi --> <html> <head> <title>[[=include.context['title'] ]]</title> </head> <body> [[=include.context['body'] ]] </body> </html> <!-- End ham.tpl.spi --> -- Santtu "Japsu" Pajukanta <ja...@pa...> |