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
1
vote
1 answer

sql alchemy + pyramid, "request cache"

i'm making a website, using pyramid, sqlalchemy and chameleon... on the view.py i send the sqlalchemy: @view_config(route_name='entity_subpage') def entity_subpage_view(request): dbsession = DBSession() User =…
Joaolvcm
  • 1,983
  • 3
  • 20
  • 24
1
vote
1 answer

"while" loops in Chameleon?

I'm working on a Pyramid project and am considering something which will come later. My particular use case is ascending the resource tree to construct a breadcrumb, but I'm curious about the general implementation, too. In Python code, I'd be…
Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
1
vote
2 answers

Chameleon template looping

I tried to create template using chameleon. Here is a code snipet. Calling module runtemp.py: delete_list=[] delete={'Name':'aaa','Sirname':'bbb','Friends':['ccc','ddd','eee']} delete_list.append(delete) templates =…
Nikhil Rupanawar
  • 4,061
  • 10
  • 35
  • 51
1
vote
1 answer

How to set TAL condition to check the file type and accordingly render the template in Plone 4.1

How to use the tal condition to check the file type and render the template in Plone 4.1 My file preview template rendering depends upon the file extension. If file extension is 'pdf', I wish to use something like this:(just started working with…
user956424
  • 1,611
  • 2
  • 37
  • 67
1
vote
1 answer

phptal - using defined variables in php conditions

I would like to use defined variables by phptal within php conditions as follows : ...
Pumpkin
  • 1,993
  • 3
  • 26
  • 32
1
vote
1 answer

How does zope/plone evaluate variables?

Imagine this scenario: I have a ZPT in Zope where I define, into a metal block, a global variable. This variable takes its value from an expression like this global myVar id | nothing; global anotherVar 1; where nothing could be replaced with…
DonCallisto
  • 29,419
  • 9
  • 72
  • 100
1
vote
2 answers

Assigning multiple classes to a tag using PHPTAL

I have an array of data I want to output as a UL using PHPTAL (easy) with class attributes supplied by the array (easy), a class attribute for first and for the last element (easy)... all at the same time (hard). Ie. I want to combine:
Steve Almond
  • 413
  • 4
  • 12
1
vote
1 answer

Doing or other boolean attribute in TAL

How one does attributes which may or may not exist? Exampls are checkbox checked="checked" or disabled="disabled" HTML attributes. What kind of tal:attributes expression is involved?
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
1
vote
1 answer

how can i check if a php associative array's key is equal to a defined variable from phptal condition?

i've this problem my phptal view has a variable called data which is an associative array. Let's suppose that i've those Keys M01 M02 and M03 not in a particular order, i've to print to the user view all the data not referred by key M02. How can i…
Marco Capoferri
  • 224
  • 2
  • 12
0
votes
1 answer

Any detailed documentation about the Chameleon Template in Pyramid Web Framework?

There's only a brief introduction to Chameleon Template in document of pyramid. Any detailed documentation/tutorial ?
Determinant
  • 3,886
  • 7
  • 31
  • 47
0
votes
1 answer

What's wrong with my PHPTAL syntax?

.Quick question - I have the following, working syntax:
Dycey
  • 4,767
  • 5
  • 47
  • 86
0
votes
4 answers

How to correctly include javascript code in chameleon/zpt template (pyramid)?

I'm trying to embed some code between tags, pyramid however doesn't like it and gives me ExpatError: not well-formed (invalid token) Probably because i have && in my code. I tried using & instead, but then it didn't get…
soulcheck
  • 36,297
  • 6
  • 91
  • 90
0
votes
1 answer

zpt xml-schema definition

Where can i find xml-schema definition for ZPT attribute language?
Odomontois
  • 15,918
  • 2
  • 36
  • 71
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

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