[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Using Zope
Page Templates
webmaster at zope.org
webmaster at zope.org
Tue Dec 2 23:05:41 EST 2003
A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ZPT.stx#2-10
---------------
For instance, template language would be useful for rendering an
invoice page, generating one row for each line item, and inserting
the description, quantity, price, and so on into the text for each
row. It would not be used to create the invoice record in a
database or to interact with a credit card processing facility.
% Anonymous User - Nov. 20, 2003 3:45 am:
I don't think this section is as clear as it could be.
.............................................
This is how I think TAL works (based on this tutorial and a few little experiments)
..............................................
TAL markup is always of the form:
tal:statement="value"
.............................................
EXAMPLE
If you create a plain text file named 'insertme' in the same directory as the Xope Page Template then stick:
tal:content="here/insertme" into the HTML <scan> tag, like this:
<scan tal:content="here/insertme">You shoudn't see this</scan>
Then what you will see once the page has been 'rendered' by Zope is simply the contents of the file
'insertme'
.............................................
1. The 'here' refers to the folder in which the template is located ???
2. This is how 'content' is kept seperate from 'presentation' ???
.............................................
I don't know if this makes anything more or less clear, or is just plain wrong.
.............................................
I think that if anybody re-writes this section they should include a few more examples.
% Anonymous User - Dec. 2, 2003 11:05 pm:
You are almost right. 'here' refers to the namespace in which the template is
currently being called, not necessarily where it's located. This is a subtle
(and often irrelevant) distinction which is explained in later chapters.
More information about the ZDP
mailing list