Questions tagged [chameleon]

Chameleon is an open-source template engine written in Python. It implements both the Zope Pagetemplate specification (TAL and TALES) and a plain text format.

Chameleon is an open-source XML/HTML template engine written in .

It’s designed to generate the document output of a web application, typically HTML markup or XML.

The language used is , originally a invention (see ), but available here as a standalone library that you can use in any script or application running Python 2.5 and up (including 3.x and pypy). It comes with a set of new features, too.

The template engine compiles templates into Python byte-code and is optimized for speed. For a complex template language, the performance is very good.

Features

  • Fast — templates are compiled to byte-code.
  • Extensible — it's easy to extend a language or create your own!
  • Tested — automated tests guard against regressions.

Official website: http://chameleon.repoze.org/

Tag use

When asking questions about the template language, consider adding (TAL constructs) and / or (METAL macro constructs) as well.

118 questions
0
votes
1 answer

Pyramid's Chameleon renderer template can't be found using relative path

I'm new to pyramid. When trying to use chameleon as the templating engine, it fails to find the template when specified with a relative path - It is looking for it at env35/lib/python3.5/site-packages/pyramid/ where env35 is the virtual environment…
Dave
  • 875
  • 6
  • 15
0
votes
1 answer

Pyramid/Chameleon - Passing data into a chameleon template

I have a Chameleon template in a Pyramid app called table_search.pt:
0
votes
1 answer

chameleon can not render deform form

I have used deform before with jinja engine but with chameleon i can not render my form I pass the form to the view to be rendered @view_config(route_name='home_cms', renderer='../views/accounts.pt', …
ADO R
  • 49
  • 1
  • 10
0
votes
1 answer

Name error while using chameleon templating in Pyramid framework

I found this error while trying to run javascript in chameleon template, with pyramid framework. This is the code that fetches data from the sqlite database. @view_config(route_name='ddo2', renderer='../templates/pages/testpage.pt') def…
Sreeram
  • 3
  • 1
0
votes
1 answer

Chameleon Template cook() function (using PyCharm/Pyramid)

In Chameleon's template.py file there's a cook(self, body) function and the problem I have occurs during executing this line: program = self._cook(body, digest, names) And this will lead to _cook(self, body, digest, buildins) function and the line…
JoeyZhao
  • 514
  • 5
  • 12
0
votes
1 answer

Chameleon template engine: loop with index

I am practicing Chameleon template engine with Bootstrap. The layout I am currently using is Fluid layout. In the listing part of this layout, its using structure like
******
Lingfeng Xiong
  • 1,131
  • 2
  • 9
  • 25
0
votes
1 answer

Lingua with Pyramids and Chameleon

i want to use lingua 3.10 for i18n in my pyramids 1.6 app, which uses chameleon templates. As far as I know, the lingua helper script should work out of the box, whereby only the path-variables of the script itself have to be edited. Unfortunately…
Tobias S
  • 1,275
  • 8
  • 23
0
votes
1 answer

Pyramid Chameleon, absolutely no idea how to iterate over a list

I have the following dictionary and I've returned this as part of my view items = { 'studentlist' : [ {'name':'alice', 'value':22}, {'name':'bob', 'value':11}, {'name':'charlie', 'value':33} ] } …
Neil Walker
  • 6,400
  • 14
  • 57
  • 86
0
votes
1 answer

How can I make a "FOR"(loop) in html, using chameleon and pyramid in python 3.4?

How can a make a loop using chameleon and pyramid in my html? I search but i found nothing like that =/ Is easier use javascript in this case? I use datatable in MACADMIN(bootstrap theme).
Adley
  • 511
  • 1
  • 6
  • 19
0
votes
1 answer

Pyramid Chameleon I18N not finding template files

I'm following this recipe, with a small test project called i18n Chameleon I18N I've set up the message_extractors as follows: message_extractors = { '.': [ ( '**.py', 'lingua_python', None ), ( '**.pt', 'lingua_xml', None ), ]}; When…
Tim Child
  • 2,994
  • 1
  • 26
  • 25
0
votes
1 answer

Bootstrap tooltips internalization - translate title attribute

I use some bootstrap tooltips ( http://getbootstrap.com/2.3.2/javascript.html#tooltips ) in my .pt file in a pyramid / python project. How to translate title attribute text using i18n:translate?
GhitaB
  • 3,275
  • 3
  • 33
  • 62
0
votes
1 answer

Any way to suppress key errors when a dictionary key is not found in Chameleon ZPT templates?

Sometimes it would be nice to be able to do this, just return None in any expression evaluating for a nonexistent dict key instead of raising KeyError.
kliron
  • 4,383
  • 4
  • 31
  • 47
0
votes
2 answers

How to add a prefix string to a TAL:attribute repeat index command?

I using TAL (template attribute language) with my Pyramid Chameleon project. I want to use a loop using TAL to define attributes in my template.
0
votes
2 answers

Localization in Pyramid ZPT Chameleon Template

I try to get string translations working in Pyramid with ZPT templates. I followed the Pyramid guide on internationalization and localization, i.e.…
romor
  • 1,181
  • 15
  • 22
0
votes
0 answers

HTML loop in Chameleon similar to that in PHP

I used to use the if statement enclosing HTML in my php pages to repeatedly produce HTML units with similar content. Would like to know the equivalent in Python Pyramid. eg:
BMC
  • 591
  • 3
  • 7
  • 22