Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9d57e3e8
Commit
9d57e3e8
authored
Sep 25, 2001
by
Amos Latteier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
progress on tales reference.
parent
55a6f28e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
32 deletions
+117
-32
lib/python/Products/PageTemplates/help/tales-exists.stx
lib/python/Products/PageTemplates/help/tales-exists.stx
+27
-0
lib/python/Products/PageTemplates/help/tales-no-call.stx
lib/python/Products/PageTemplates/help/tales-no-call.stx
+30
-3
lib/python/Products/PageTemplates/help/tales-not.stx
lib/python/Products/PageTemplates/help/tales-not.stx
+11
-1
lib/python/Products/PageTemplates/help/tales-path.stx
lib/python/Products/PageTemplates/help/tales-path.stx
+14
-4
lib/python/Products/PageTemplates/help/tales.stx
lib/python/Products/PageTemplates/help/tales.stx
+35
-24
No files found.
lib/python/Products/PageTemplates/help/tales-exists.stx
0 → 100644
View file @
9d57e3e8
TALES Exists expressions
Syntax
Exists expression syntax::
exists_expressions ::= 'exists:' path_expression
Description
Exists expressions test for the existence of paths. An exists
expression returns true when the path expressions following it
expression returns a value. It is false when the path expression
cannot locate an object.
Examples
Testing for the existence of a form variable::
<p tal:condition="not:exists:request/form/number">
Please enter a number between 0 and 5
</p>
Note that in this case you can't use the expression,
"not:request/form/number", since that expression will be true if
the 'number' variable exists and is zero.
\ No newline at end of file
lib/python/Products/PageTemplates/help/tales-no-call.stx
View file @
9d57e3e8
TALES No
call expressions
TALES No
-
call expressions
Syntax
XXX
No-call expression syntax::
nocall_expression ::= 'no-call:' expression
Description
XXX
\ No newline at end of file
No-call expressions avoid rendering the results of another
expression.
An ordinary path expression tries to render the object that it
fetches. This means that if the object is a function, Script,
Method, or some other kind of executable thing, then expression
will evaluate to the result of calling the object. This is
usually what you want, but not always. For example, if you want
to put a DTML Document into a variable so that you can refer to
its properties, you can't use a normal path expression because it
will render the Document into a string.
Examples
Using no-call to get the properties of a document::
<span tal:define="doc nocall:here/aDoc"
tal:content="string:${doc/getId}: ${doc/title}">
Id: Title</span>
Using no-call expressions on a functions::
<p tal:define="join nocall:modules/string/join">
This example defines a variable 'join' which is bound to the
'string.join' function.
lib/python/Products/PageTemplates/help/tales-not.stx
View file @
9d57e3e8
...
...
@@ -2,7 +2,9 @@ TALES Not expressions
Syntax
XXX
Not expression syntax::
not_expression ::= 'not:' expression
Description
...
...
@@ -28,3 +30,11 @@ TALES Not expressions
Zope considers all objects not specifically listed above as
*false* (including negative numbers) to be *true*.
Examples
Testing a sequence::
<p tal:condition="not:here/objectIds">
There are no contained objects.
</p>
lib/python/Products/PageTemplates/help/tales-path.stx
View file @
9d57e3e8
...
...
@@ -55,7 +55,17 @@ TALES Path expressions
Examples
XXX
Inserting a cookie variable or a property::
<span tal:replace="request/cookies/pref | here/pref">
preference
</span>
Inserting the user name::
<p tal:content="user/getUserName">
User name
</p>
...
...
lib/python/Products/PageTemplates/help/tales.stx
View file @
9d57e3e8
...
...
@@ -36,7 +36,9 @@ TALES Overview
These are the TALES expression types supported by Zope:
* "no-call":tales-no-call.stx expression - don't call a value
* "exists":tales-exists.stx expressions - test existence of a value
* "no-call":tales-no-call.stx expressions - don't call a value
* "not:tales-not.stx expressions - negate a value
...
...
@@ -55,11 +57,16 @@ TALES Overview
a *non-value* (e.g. void, None, Nil, NULL).
- *default* - special singleton value used by TAL to specify that
existing text should not be replaced.
existing text should not be replaced. See the documentation for
individual TAL statements for details on how they interpret
*default*.
- *options* - the *keyword* arguments passed to the template.
- *options* - the *keyword* arguments passed to the template. These
are generally available when a template is called from Python,
rather than from the web.
- *repeat* - the 'repeat' variables (see RepeatVariable).
- *repeat* - the 'repeat' variables see the
"tal:repeat":tal-repeat.stx documentation.
- *attrs* - a dictionary containing the initial values of the
attributes of the current statement tag.
...
...
@@ -68,11 +75,13 @@ TALES Overview
used to access a builtin variable that has been hidden by a local
or global variable with the same name.
- *root* - the system's top-most object.
- *root* - the system's top-most object. In Zope this corresponds
to the root folder.
- *here* - the object to which the template is being applied.
- *container* - the template's container object.
- *container* - the template's container object. In Zope this is
the folder in which the template is located.
- *template* - the template itself.
...
...
@@ -93,7 +102,9 @@ TALES Overview
"TAL overview":tal.stx
"no-call":tales-no-call.stx expression
"exists":tales-exists.stx expressions
"no-call":tales-no-call.stx expressions
"not:tales-not.stx expressions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment