Questions tagged [template-metal]

METAL (Macro Expansion Template Attribute Language) is an extension to TAL, XML-attribute based templating language standard to add macro functionality, used by Zope Page Templates, Chameleon, PHPTAL and other templating libraries.

METAL (Macro Expansion Template Attribute Language) adds macro capabilities to TAL; see .

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

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 METAL syntax questions. Consider using the , or tags as needed if the question is specific to an implementation.

22 questions
11
votes
3 answers

How to use template inheritance with Chameleon?

I am using latest Pyramid to build a web app. Somehow we have started using Chameleon as the template engine. I have used Mako before and it was extremely simple to create a base template. Is this possible with chameleon as well? I have tried to…
Ranjith Ramachandra
  • 10,399
  • 14
  • 59
  • 96
9
votes
1 answer

Pyramid framework and master templates / master page / partial views

I'm experienced with .NET MVC and wanting to learn a Python framework. I chose Pyramid. .NET MVC has the concept of a master page, views and partial views. A master page would look something like: <%@ Master Language="C#"…
qxn
  • 17,162
  • 3
  • 49
  • 72
7
votes
3 answers

Override only the Description field of the Plone standard content type

I would like to ovverride only the "view" of the classic "description field" of the Plone standard content type (Document, Folder, blabla), cause I need to "structure" the text of this field with structured text like: This is my…
Vito
  • 1,201
  • 1
  • 10
  • 16
4
votes
1 answer

Python Pyramid - Add multiple chameleon base templates

I am using this procedure to use a base template which the other templates can derive from. How can I create multiple base templates?
Sukumar
  • 3,502
  • 3
  • 26
  • 29
3
votes
1 answer

Can I nest multiple template objects inside another chameleon template?

Say I had a chameleon template file for a user object with something like this:

Can I loop over a list of users in another template file to…
c0lon
  • 210
  • 1
  • 9
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
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

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

How do you specify the html5 doctype with Python Chameleon?

I've thoroughly RTFMed and Googled for this, and I can't seem to find the answer. I am new to Chameleon, so maybe it's just so obvious that it's no where to be found, but when I put in my master template, the rendered page has it…
Jesse Kochis
  • 766
  • 3
  • 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
1 answer

Why is a variable defined outside a fill-slot or define-macro element not visible inside this element?

Why is a variable defined outside a fill-slot or define-macro element not visible inside this element?
wolfrevo
  • 6,651
  • 2
  • 26
  • 38
2
votes
1 answer

How to print unclosed tags in PHPTAL Macros

I'm in the process of transitioning a site to using PHPTAL templates, for now I am writing all new pages using templates while leaving the existing pages as is. The older pages use a standard header and footer, a typical page has it's content…
J.R.
  • 21
  • 3
2
votes
1 answer

Zope (ZPT) overlapping tags

I try to create an open div tag condition and close a div tag in another condition with TAL in a Zope Page Template but I'm not allowed to overlap tags. Here is my code :
Cyrille
  • 13,905
  • 2
  • 22
  • 41
2
votes
1 answer

Chameleon template global variables

I am using Pyramid 1.3 and their templates written in Chameleon. As different pages or templates might need a global stylesheet change per page, I would like to be able to redefine classes of the body tag on the page (of course, I would prefer to do…
Andrey Cizov
  • 695
  • 10
  • 20
1
vote
2 answers

What specific issue try zope folks to solve with TAL, TALES & METAL

TAL, TALES and METAL are all three the zope templating language. The thing that I don't understand is why so much troubles. I don't understand the spirit of ZTL, any tips ? one more question : is there a standalone library that try to achieve the…
amirouche
  • 7,682
  • 6
  • 40
  • 94
1
2