I suspect you're going to want to store client side template separately from
the ZPT and inject it at render time.  Does this work?

In Python:

  jstemplate = "blah blah blah <% some expression %> blah blah"
  rendered = render_template("template.pt", jstemplate=jstemplate)


  blah blah
  <div tal:replace="structure jstemplate"/>
  blah blah


On Tue, Oct 12, 2010 at 1:40 PM, Paul Everitt <p...@agendaless.com> wrote:

> Hi all.  Before this floats out of my brain, I thought I'd write it down
> and see what people think.
> In the past few months I've done a bit of client-side templating in jQuery,
> first using John Resig's microtemplating:
>  http://ejohn.org/blog/javascript-micro-templating/
> ...as well as the just-announced-as-core templating:
> http://blog.jquery.com/2010/10/04/new-official-jquery-plugins-provide-templating-data-linking-and-globalization/
> I used these in KARL which uses Chameleon 1.1.1.  All was happy.
> I tried both today on a new project which uses Chameleon 1.2.13.  Chameleon
> didn't like the syntax, which in one case looks like this:
>  <% some expression %>
> ....and in another:
>  ${somevar}
> In the first case, Chameleon refuses to parse the zpt because Expat tries
> to interpret <% as a startTag.  In the second case...needless to say, it is
> ironic that we have overlap in syntax.  I then tried wrapping a CDATA around
> the block, but Chameleon happily plowed into the CDATA looking for stuff to
> evaluate.
> I was going down the path of demand-loading my templates with a second
> request when I stumbled across an obscure point in the docs saying that
> ${somevar} and {{= somevar}} are interchangeable for the second URL above.
>  Thus, I'm less in a pickle, but thought I'd bring it up anyway.
> --Paul
> _______________________________________________
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev
Repoze-dev mailing list

Reply via email to