summaryrefslogtreecommitdiff
path: root/doc/reference
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2014-09-11 10:51:08 +0200
committerXavier Morel <xmo@openerp.com>2014-10-06 19:13:45 +0200
commitd5e3d121e3733de189605da7f830ff3d7c20b8d8 (patch)
tree4daf7ad43b8cb665261387860a950283cced2615 /doc/reference
parent2ffcff8fa9bd58beee33170be5a11649ec282602 (diff)
[ADD] qweb: call directive's body
* __content__ can't be used in Python implementation because safe_eval, so use ``0`` from Python implementation instead * remove postfix from t-call tests because due to implementation details all whitespace crap following a t-name is added to rendered template in Python impl, and don't want to normalize whitespace.
Diffstat (limited to 'doc/reference')
-rw-r--r--doc/reference/qweb.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/reference/qweb.rst b/doc/reference/qweb.rst
index 8e8a213af44..b57d78dcbca 100644
--- a/doc/reference/qweb.rst
+++ b/doc/reference/qweb.rst
@@ -269,6 +269,28 @@ evaluated *before* calling the sub-template, and can alter a local context::
</t>
<!-- "var" does not exist here -->
+The body of the ``call`` directive can be arbitrarily complex (not just
+``set`` directives), and its rendered form will be available within the called
+template as a magical ``0`` variable::
+
+ <div>
+ This template was called with content:
+ <t t-raw="0"/>
+ </div>
+
+being called thus::
+
+ <t t-call="other-template">
+ <em>content</em>
+ </t>
+
+will result in::
+
+ <div>
+ This template was called with content:
+ <em>content</em>
+ </div>
+
Python
======