Questions tagged [template-tal]

TAL (Template Attribute Language) is a XML-attribute based templating language standard, used by Zope Page Templates, Chameleon, PHPTAL and other templating libraries.

TAL (Template Attribute Language) is a XML-attribute based templating language standard, used by Zope Page Templates, Chameleon and other templating libraries.

A sister language METAL (Macro Expansion Template Attribute Language) adds macro capabilities to TAL; use the tag for questions specific to macro handling.

The language is aimed at making collaboration between designers and programmers easier, by hiding all templating constructs in XML or HTML attributes, allowing a template editor to create and maintain templates that still render in a browser.

Use this tag for general TAL syntax questions. Consider using the , or tags as needed if the question is specific to an implementation.

90 questions
3
votes
2 answers

Configurable head with chameleon load

When using chameleon, I can replace element from a base template using the concept of slot. Where you define a slot and fill it using another tag. As there is no container element in head, how can one add elements to head ? : The Layout…
3
votes
2 answers

Storing data in HTML tags as custom attributes

Is it a good practice storing related information in the HTML tag? $("#my_div").append(""); $("#info").attr("boo"); I've encountered with such technique (and slightly borrowed it) in TAL (in ZPT) where you could use…
rook
  • 5,880
  • 4
  • 39
  • 51
3
votes
1 answer

how to use macros with pyramid / ZPT (Chameleon)

I want to use macros with pyramid+ZPT engine (Chameleon). The docs say that "A single Page Template can accommodate multiple macros." http://chameleon.readthedocs.org/en/latest/reference.html#macros-metal Thus I defined a file macros.pt:
Knut
  • 431
  • 4
  • 14
3
votes
2 answers

Line Breaking in Chameleon

I have used the pyramid framework to build a large web application. Among other things, this application allows the user to enter text into a text area form field. This text is then saved to a database and of course can be readout again and…
Meneldur
  • 215
  • 1
  • 5
3
votes
1 answer

Changing attributes in Zope templates

I'm writing a template for an object that contains files. I'm following the theme building blocks instructions. foo That makes that the liks downloads the file, as this: foo But I want that…
Daniel Hernández
  • 1,279
  • 8
  • 15
3
votes
2 answers

Rendering nested elements with an arbitrary depth using Chameleon ZPT

I am using Pyramid framework and I would like to render with Chameleon a html menu with nested lists (ul, li) of an arbitrary depth. I cannot find some sort of recursive method in Chameleon in order to do so. It seems such a common need so I am…
user1919510
3
votes
1 answer

Ignore XML Namespace (TAL) in SublimeLinter

I'm using SublimeText 2 and SublimeLinter, and I develop for Zope and Plone. In the page templates (.pt) I get lots of errors for namespace problems, which I would like to either fix or have SublimeLinter ignore. For example:
Spanky
  • 5,608
  • 10
  • 39
  • 45
3
votes
1 answer

Tal condition, defining multiple conditions within same line

Is there an alternative to what I do below : ...
...
... Such as : ...
Pumpkin
  • 1,993
  • 3
  • 26
  • 32
3
votes
2 answers

PHPTAL: how to dump an object to see all properties

I have to modify the PHPTAL template below by adding another field, "location"
Name: contact name
Number:
Xoundboy
  • 827
  • 15
  • 26
3
votes
2 answers

ParseError: Unexpected end tag - How to clean html tags?

I'm starting to learn web development and am using pyramid with chameleon. I just took some sites html source as a template in Dreamweaver and then copied the code into a chameleon .pt file. The html code displays fine in dreamweaver but I get this…
Lostsoul
  • 25,013
  • 48
  • 144
  • 239
2
votes
1 answer

POT file with tags instead of

I'm trying to translate text out of a template file in a Pyramid project. More or less as in this example: http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/chameleon_i18n.html Now how do I get rid of the in the…
lukas
  • 183
  • 1
  • 1
  • 10
2
votes
1 answer

Inject rendered content from several views in Pyramid into one base template

I'd like to do something like below. I have the following routes configured: config.add_route('home', '/') config.add_route('foo', '/foo') The following views: @view_config(route_name='home', renderer='templates/home.pt') def home_view(request): …
rtn
  • 127,556
  • 20
  • 111
  • 121
2
votes
2 answers

How to retrieve the value of a key in a dictionary using a variable defined in TAL?

I have defined a dictionary in python: tal:define="dic python:{'a':'1', 'b':'2'};" I have another variable defined using tal:define called var, which is either 'a' or 'b'. I get an error when I try to do: tal:define="foo…
JCarter
  • 407
  • 3
  • 11
2
votes
7 answers

Java Template library similar to ZPT (attribute language)

I've been using ZPT in python recently and I love the templating language. I was looking for something similar for Java but couldn't really find anything I liked as well. The closest thing is FreeMarker. The problem with FreeMarker and the other…
Falmarri
  • 47,727
  • 41
  • 151
  • 191
2
votes
1 answer

Pyramid and Chameleon ZPT Repetition

I am trying to loop through a list and get an output like this: Python: items=['item1', 'item2', 'item3'] return dict(items=items) HTML: