Commit 9f049164 authored by Amos Latteier's avatar Amos Latteier

Changed first and last example to be clearer. Documented the fact that the...

Changed first and last example to be clearer. Documented the fact that the last path in an alternate path experssion doesn't need to be a path at all.
parent 6049e415
......@@ -110,11 +110,16 @@ repeat: Repeat an element
</tr>
</table>
Objects (already sorted by meta-type) in groups by meta-type::
Insert objects. Seperates groups of objects by meta-type by
drawing a rule between them::
<table border="1">
<tr tal:repeat="object objects">
<td><span tal:condition="repeat/object/first/meta_type"
tal:replace="object/meta_type">Meta Type</span></td>
</tr>
</table>
<div tal:repeat="object objects">
<h2 tal:condition="repeat/object/first/meta_type"
tal:content="object/meta_type">Meta Type</h2>
<p tal:content="object/getId">Object ID</p>
<hr tal:condition="repeat/object/last/meta_type" />
</div>
Note, the objects in the above example should already be sorted by
meta-type.
......@@ -24,6 +24,7 @@ TALES Path expressions
nothing
here/some-file 2001_02.html.tar.gz/foo
root/to/branch | default
request/name | string:Anonymous Coward
When a path expression is evaluated, Zope attempts to traverse the
path, from left to right, until it succeeds or runs out of paths
......@@ -40,6 +41,12 @@ TALES Path expressions
If a traversal step fails, evaluation immediately proceeds to the next
path. If there are no further paths, an error results.
The expression in a series of paths seperated by vertical bars can
be any TALES expression. For example, 'request/name |
string:Anonymous Coward'. This is useful chiefly for providing
default values such as strings and numbers which are not
expressable as path expressions.
If no path is given the result is *nothing*.
Since every path must start with a variable name, you need a set
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment