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

Of Methods And Madness - Zope

Always wanted to learn DTML, but didn't know where to start? Today's your lucky day.

  1. DTML Basics (part 1)
  2. Upper Management
  3. Dissecting DTML
  4. Of Methods And Madness
  5. Introducing Yourself
  6. Green Cheese And Pink Frogs
By: Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 9
May 21, 2002

print this article


In addition to DTML Documents, Zope also includes a strange animal called a DTML Method. There are a number of fairly obvious similarities between a DTML Document and a DTML Method, together with some very subtle differences. It's the differences that can catch you out - which is why you should get to know them at this stage itself.

The most important of these differences is that while a DTML Document is an object with properties of its own, a DTML Method is an object which inherits properties from its container. Which is why, if you create a DTML Method

and take a look at it in the Zope management interface, you'll notice the absence of a "Properties" tab on the top of the page (DTML Documents, on the other hand, have a very visible "Properties" tab).

As an illustration, create two objects, one a DTML Document and the other a DTML Method, and attach the following code to each:

I am <dtml-var id>
Now, when you view these objects, you'll see that the DTML Document displays its ID correctly,

I am FirstStep
whereas the DTML Method displays the ID of its container - the parent folder (which I named "DTML Basics" a couple of pages ago).

I am DTML Basics
Consequently, DTML Documents are typically used to display static content, while DTML Methods are used to display dynamic content..

>>> 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: