[Zope-CMF] <metal> and <tal> tag in ZPT

Tres Seaver tseaver@zope.com
30 Apr 2002 16:31:00 -0400

On Tue, 2002-04-30 at 15:51, Michael McLay wrote:
> In the page template portal_skins/zpt_generic/main_template the following 
> statement seems to be an error. 
>     <metal:block define-slot="base" /> 
> I found no reference to a <metal> in the current METAL or TAL specification.

The element is actually in the METAL namespace;  that is, its name
really is '<metal:block>', not '<metal>'.  It exists for the relatively
rare case when macro expansion needs to be able to insert a slot into
the middle of another element, and can't be attached to any other
(legal) element (for instance, '<div>' is illegal inside the '<head>'

> I also found serveral comments in the Zope Book AdvZPT in which a <tal> tag 
> was used. Here's one of the examples:
>   <tal:formfields repeat="field python:form.get_fields()">
>   <tal:fieldid define="fieldId python:field.getId()">
>   <tal:m_formaterrorbyfield
>         metal:use-macro="here/PT_macros/macros/formatErrorByField"
>         condition="python:errorMap.has_key(fieldId)">
>   <p class="errorMessage"
>                tal:content="python:errorMap[fieldId].error_text"></p>
>   </tal:m_formaterrorbyfield>
>   </tal:fieldid>
>   </tal:formfields>
> Is this residual syntax from an earlier form of TAL and METAL?  This seems to 
> be the case but the <tal> comments were posted very recently. Is the syntax 
> a new addition to TAL?
> Muddling through the documentation for over an hour has not made the correct 
> interpretation apparent to me. Am I missing something obvious?

I don't think I've ever used '<tal:xxx>' for anything, although it
should be legal XML / XHTML.  Normally, I have "real" elements to hang
the TAL off of.

Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com