[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Dynamic Content with DTML
Thu, 29 Aug 2002 11:15:31 -0400
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/DTML.stx#2-30
Suppose you have a folder whose id is *Feedbags* that has the title
"Bob's Fancy Feedbags". Inside the folder
create a DTML Method with an id of *pricelist*. Then change the
contents of the DTML Method to the following::
<h1>Price list for <dtml-var title></h1>
<p>Hemp Bag $2.50</p>
<p>Silk Bag $5.00</p>
% Anonymous User - Apr. 27, 2002 6:39 pm:
Why are we suddenly using a method? I would think the title insert would happen with either a document or a
method and the rest of the document appears to be content, therefore use a document.
% Anonymous User - Apr. 27, 2002 6:43 pm:
Is the difference that a document has a title, even if null and a method never does so it always inherit's
its container's title? If that is the case, why is a title prompted for in the ZMI?
% Anonymous User - Aug. 29, 2002 11:15 am:
Method works on its container (or, rather, its caller(AKA context)). All properties and content in method
come from its context.
Document does not care about context - it has its own properties. And it can't access content in a way that
method can: method sees the content of folder it's called on, and a document is not a folder.