Home arrow Zope arrow Page 4 - ZPT Basics (part 1)

Anatomy Lesson - Zope

Contrary to what you might think, DTML isn't the only programming language available to you in Zope. Take a look at Zope Page Templates (ZPT), a template-based alternative that makes it easier for designers and developers to collaborate on Zope application development.

  1. ZPT Basics (part 1)
  2. The Power Of Three
  3. Practical Magic
  4. Anatomy Lesson
  5. Putting It All In Context
By: Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 23
September 18, 2002

print this article


There are a number of TALES expressions in the code snippet shown in the previous page - here's the first one:

<title tal:content="template/title">The title</title>
As you've already seen, this means "replace the content enclosed within the <title> element with the result obtained by evaluating the TALES expression [template/title]".

When the template is rendered, this TALES expression will evaluate to the title of the current page, which will appear within the <title> tag, like this:

<title>Hello ZPT!</title>
The second statement is similar, except that this time, the element itself is replaced, together with the content enclosed within it. When the page is rendered, the TAL statement

<h2>Welcome to <span tal:replace="here/title_or_id">content title or id</span></h2>
will replace the <span>...</span> tags with the results of evaluating the TALES expression within it, like this:

<h2>Welcome to ZPT Basics</h2>

>>> More Zope Articles          >>> More By Harish Kamath, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Creating Zope Products
- Plone Content Types With Archetypes
- Flat User Management in Zope
- Creating Basic Zope Applications
- Getting started with Zope for Linux and Sola...
- ZPT Basics (part 4)
- ZPT Basics (part 3)
- ZPT Basics (part 2)
- ZPT Basics (part 1)
- Exception Handling In DTML
- DTML Basics (part 4)
- DTML Basics (part 3)
- DTML Basics (part 2)
- DTML Basics (part 1)
- Using Zope With Apache

Developer Shed Affiliates


Dev Shed Tutorial Topics: