Kevin, The TemplateState that has your loaded templates must be passed to renderTemplate every time you call it. If storing that value in the state maintained by MyMonad is convenient for you, then that is a fine approach. Eventually Snap will probably have a monad that does this for you.
Doug Beardsley On Wed, Jun 23, 2010 at 5:22 AM, Kevin Jardine <[email protected]> wrote: > Hi Gregory, > > Fortunately I already knew that bit. > > It turns out that the problem was that the template store in my splice > function did not contain the loaded templates. I'm not sure why. > > If I just do something like: > > ts <- getTS > > in a splice function called by renderTemplate, the templates I loaded and > passed to renderTemplate do not seem to be there. > > So instead I keep a template store variable in MyMonad and use that instead. > > Now everything works as expected. > > Cheers, > Kevin > > --- On Wed, 6/23/10, Gregory Collins <[email protected]> wrote: > >> From: Gregory Collins <[email protected]> >> Subject: Re: [Snap Framework] renderTemplate with XML fragments in Heist >> To: "Kevin Jardine" <[email protected]> >> Cc: [email protected] >> Date: Wednesday, June 23, 2010, 12:00 AM >> Kevin Jardine <[email protected]> >> writes: >> >> > My error I think - I was assuming that loadTemplates >> loads template >> > directories recursively like StringTemplate, but in >> fact it appears >> > that it only loads templates in the given directory, >> correct? >> >> They load recursively but if a template is in "foo/bar.tpl" >> you have to >> address it as "foo/bar". >> >> G >> -- >> Gregory Collins <[email protected]> >> > > > > _______________________________________________ > Snap mailing list > [email protected] > http://mailman-mail5.webfaction.com/listinfo/snap > _______________________________________________ Snap mailing list [email protected] http://mailman-mail5.webfaction.com/listinfo/snap
