[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Using Zope Page Templates

webmaster at zope.org webmaster at zope.org
Sat Apr 10 22:28:09 EDT 2004


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ZPT.stx#2-13

---------------

    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.

      % Anonymous User - Feb. 13, 2004 5:05 pm:
       I hope Anonymous User - Nov. 20, 2003 3:45 am meant the "span" tag and not the "scan" tag, because otherwise
       I'm even more confused than I think I am.

      % Anonymous User - Apr. 10, 2004 10:28 pm:
       It would be very useful if when a line of program code is typed, that the next entry be typed as the line of
       code were displayed by the web browser. When I see a word, "Table" in a line of code, does it mean taht the
       word is a command, a variable, a word which must match the same word in a look-up matrix or what? If the the
       word, "Title" means and when rendered as a web page will display, "Susan Jones Home Page", then so state in
       the line of code. Don't leave me wondering if "title" has some dark, magic meaning, or is simply a short-hand
       place holder which the web page designer will eventually substitute with "Susan Jones Home Page." KISS,
       PLEASE.
       Thanks,
       Jim



More information about the ZDP mailing list