A comment to the paragraph below was recently added via 


  Zope Page Templates are an HTML/XML generation tool. This appendix
  is a reference to Zope Page Templates standards: Tag Attribute
  Language (TAL), TAL Expression Syntax (TALES), and Macro Expansion
  TAL (METAL).  It also describes some ZPT-specific behaviors that are
  not part of the standards.

    % snell - Nov. 15, 2003 5:20 am:
     There is no reference to metal:block
     Zope Page Templates Reference
     Page Templates
     Advanced Page Templates
     What is it for?

    % Anonymous User - Nov. 23, 2003 3:01 pm:
     tal:block or metal:block can be used on tag-level
     if you have no html-tag to put your tal/metal code on.

    % Anonymous User - Nov. 23, 2003 3:02 pm:
     for instance, outside of the html-tag.

    % Anonymous User - Apr. 14, 2004 10:17 am:
     I have found a tal function that is never used or described in any of 
these pages or the WWW after a search
     on 5 searchpages. Except in a subproduct for Zope (Plone) (but they don't 
explain tal usage on their site so
     I'll ask it here)
       <tal:datetime define="today python:DateTime().earliestTime()">

     First thing that intrigues me: There is no standard html tag around this 
tal, I thought only
     tal:block could do that?
     Second thing I noticed: All the code that remained between those tags 
(represented by "...") appeared in the
     resulting page without problem, but there remained nothing visible of 
these "tal:datetime" tags.
     Third thing I noticed: straight after the tal:datetime statement comes 
define="...", clearly working as the
     tal:define explained later in this apendix. Why has there been no need to 
write "tal:" in front of it?
     Is this some faulty page template code, yet still beeing accepted by the 
     Could this code have been replaced by a simple <tal:block 
tal:define="..."> ... </tal:block> or <span
     tal:omit-tag tal:define="..."> ... </span>?
     Or is there a possibility to extend the tal-statements and why isn't it 
told here then?

    % Anonymous User - Apr. 14, 2004 10:30 am:
     You need to understand namespaces. In an HTML page, the default namespace
     is that of HTML. The browser will attempt to parse all tags in this 

     To put a tag in a different namespace, which will be ignored by the 
     prefix it with the namespace, e.g. to put a tag in the 'tal' namespace, 
        <tal:XXXX ... />
     The same goes for attributes. To put an attribute in the 'tal' namespace, 
     write:   <span tal:define="..." />
     If an element is in the 'tal' namespace, all its attributes are also in 
     namespace. That is why it is *not* necessary to write:  
       <tal:datetime tal:define="..." />
     The second 'tal:' is redundant. 

     The next thing to understand: TAL (the Template ATTRIBUTE language) only
     pays attention to *attributes*. It ignores tags. Therefor the XXX in 
       <tal:XXX ...> 
     can be anything -- it will be ignored by the TAL parser. It's a good idea
     to make it something descriptive.

    % Anonymous User - Aug. 6, 2005 6:52 pm:

    % Anonymous User - Aug. 12, 2005 5:02 pm:

    % inflatables - Oct. 14, 2005 11:42 pm:
ZDP maillist  -  ZDP@zope.org

Reply via email to