[Grok-dev] megrok.chameleon template engine

Sebastian Ware sebastian at urbantalk.se
Tue Feb 24 10:20:42 EST 2009


Looks interesting. The automatic reloading of page templates isn't  
working either so that won't be a huge loss. My only concern would be  
if Chameleon will be a first class citizen with Grok. It would be  
great to know what level of commitment one can expect regarding  
support of these alternative templating solutions.

Mvh Sebastian

24 feb 2009 kl. 15.28 skrev Uli Fouquet:

> Hi Sebastian,
>
> Sebastian Ware wrote:
>> Did I understand it correctly that Chameleon only supports TALES
>> python expressions?
>
> `chameleon.zpt` supports TALES python expressions _by default_. Here  
> is
> the whole picture:
>
> As far as I can see (could not find complete documentation for all
> use-cases) it supports TALES Python expressions,::
>
>  <div tal:content="view.myval">MyVal</div>
>
> TALES string expressions::
>
>  <div tal:content="string:Hello" />
>
> and TALES structure expressions::
>
>  <div tal:content="structure: view.myval" />
>
> TALES path expressions are _not_ supported currently as far as I can
> see. This also applies to TALES ``exists:`` expressions.
>
> For me it is much more convenient to write a Python expression than a
> path expression so I do not miss it very much. It was indeed the main
> reason for me to write this extension: getting rid of "python:...".
>
> Furthermore you can use the usual suspects like
>
> * tal:define
> * tal:attributes
> * tal:content
> * tal:replace
> * tal:condition
> * tal:omit-tag
> * metal:define-slot
> * metal:fill-slot
>
> and, additionally, Genshi-like interpolation inside and outside tags::
>
>  <div name="${view.myval}">
>    ${view.myval}
>  </div>
>
> which is also very convenient IMHO.
>
> A `megrok.chameleon` specific drawback is, that template changes are  
> not
> reloaded automatically on changes. This could be changed but might  
> mean
> a remarkable performance decrease.
>
> Hope that helps,
>
> -- 
> Uli
>



More information about the Grok-dev mailing list