Description
Plone uses TAL template language for its templates. This document contains references to this template language and generally available templates, macros and views you can use to build your Plone add-on product.
Plone uses TAL template language which has METAL extensions for macros. TALES expressiong
Plone 3 has two kind of template
See browser:page
TAL is template language used Plone. TAL is XML based language, which puts programming logic to XML attributes.
By default, all TAL output is escaped for the security reasons.
view.text = "<b>Test</b>"
<div tal:content="view/text" />
Will output escaped HTML source code:
<b>Testlt;/b>
Unescaped content can be outputted using tal:replace attribute and structure.
<div tal:replace="structure view/text" />
Will output unescaped HTML source code:
<b>Test</b>
METAL is TAL extension to provide macros and slots to the template language.
Using METAL macros is no longer recommended, since they couple programming logic too tightly with the template language. You should use views instead.
Read more about in TAL Guide.
TALES expressions are condition clauses used in TAL templates and various other parts of Plone
Read more about expressions in TAL Guide.
See Expressions chapter for more information.
By default, Plone main_template has slots for left and right portlets. If you have a view where you don’t explicitly want to render portlets you can do
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="here/main_template/macros/master"
i18n:domain="plone">
<head>
<metal:block fill-slot="column_one_slot" />
<metal:block fill-slot="column_two_slot" />
</head>
By default, Plone draws green edit frame around the content if you can edit it. You might want to disable this behavior for particular views.
If you’d like to hide the (green) editing frame place the following code to your Zope 2 like page template:
<metal:block fill-slot="top_slot"
tal:define="dummy python:request.set('disable_border',1)" />
Examples of this usage