My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
WhatIsTAL  
Template Attribute Language introduction
Updated Feb 4, 2010 by pawel.knapik

Introduction

Learn more about TAL:

Details

TAL templates have to be well-formed XML documents, for example:

<div xmlns:tal="http://xml.zope.org/namespaces/tal">
<h1 tal:content="string: Welcome">Header</h1>
<p tal:content="pagedata/introduction">introduction copy here</p>
<a tal:attributes="href: pagedata/links/readmore">read more</a>
</div>

The big advantage of TAL for web designer/developer is that template may be rendered in web browser as-is, without data and parsing. The above example would render like:

<div>
<h1>Header</h1>
<p>introduction copy here</p>
<a>read more</a>
</div>

Assuming variables:

  • pagedata/introduction` == "the real introduction copy"
  • pagedata/links/readmore` == "readmore.html"

processing the example by parser will generate:

<div>
<h1>Header</h1>
<p>the real introduction copy</p>
<a href="readmore.html">read more</a>
</div>

Sign in to add a comment
Powered by Google Project Hosting