Mercurial > p > roundup > code
comparison doc/customizing.txt @ 1448:bbb1e5f8fc93
added info about structure/not:/path()
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 18 Feb 2003 21:10:42 +0000 |
| parents | 2f6647cf5345 |
| children | fd806ad85621 |
comparison
equal
deleted
inserted
replaced
| 1447:6118d4498db3 | 1448:bbb1e5f8fc93 |
|---|---|
| 1 =================== | 1 =================== |
| 2 Customising Roundup | 2 Customising Roundup |
| 3 =================== | 3 =================== |
| 4 | 4 |
| 5 :Version: $Revision: 1.74 $ | 5 :Version: $Revision: 1.75 $ |
| 6 | 6 |
| 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: | 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: |
| 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx | 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
| 9 | 9 |
| 10 .. contents:: | 10 .. contents:: |
| 996 If an element in the path may not exist, then you can use the ``|`` | 996 If an element in the path may not exist, then you can use the ``|`` |
| 997 operator in the expression to provide an alternative. So, the expression | 997 operator in the expression to provide an alternative. So, the expression |
| 998 ``request/form/foo/value | default`` would simply leave the current HTML | 998 ``request/form/foo/value | default`` would simply leave the current HTML |
| 999 in place if the "foo" form variable doesn't exist. | 999 in place if the "foo" form variable doesn't exist. |
| 1000 | 1000 |
| 1001 You may use the python function ``path``, as in ``path("item/status")``, to | |
| 1002 embed path expressions in Python expressions. | |
| 1003 | |
| 1001 **String Expressions** - eg. ``string:hello ${user/name}`` | 1004 **String Expressions** - eg. ``string:hello ${user/name}`` |
| 1002 These expressions are simple string interpolations - though they can be just | 1005 These expressions are simple string interpolations - though they can be just |
| 1003 plain strings with no interpolation if you want. The expression in the | 1006 plain strings with no interpolation if you want. The expression in the |
| 1004 ``${ ... }`` is just a path expression as above. | 1007 ``${ ... }`` is just a path expression as above. |
| 1005 | 1008 |
| 1006 **Python Expressions** - eg. ``python: 1+1`` | 1009 **Python Expressions** - eg. ``python: 1+1`` |
| 1007 These expressions give the full power of Python. All the "root level" | 1010 These expressions give the full power of Python. All the "root level" |
| 1008 variables are available, so ``python:item.status.checklist()`` would be | 1011 variables are available, so ``python:item.status.checklist()`` would be |
| 1009 equivalent to ``item/status/checklist``, assuming that ``checklist`` is | 1012 equivalent to ``item/status/checklist``, assuming that ``checklist`` is |
| 1010 a method. | 1013 a method. |
| 1014 | |
| 1015 Modifiers: | |
| 1016 | |
| 1017 **structure** - eg. ``structure python:msg.content.plain(hyperlink=1)`` | |
| 1018 The result of expressions are normally *escaped* to be safe for HTML | |
| 1019 display (all "<", ">" and "&" are turned into special entities). The | |
| 1020 ``structure`` expression modifier turns off this escaping - the result | |
| 1021 of the expression is now assumed to be HTML structured text. | |
| 1022 | |
| 1023 **not:** - eg. ``not:python:1=1`` | |
| 1024 This simply inverts the logical true/false value of another expression. | |
| 1025 | |
| 1011 | 1026 |
| 1012 Template Macros | 1027 Template Macros |
| 1013 ~~~~~~~~~~~~~~~ | 1028 ~~~~~~~~~~~~~~~ |
| 1014 | 1029 |
| 1015 Macros are used in Roundup to save us from repeating the same common page | 1030 Macros are used in Roundup to save us from repeating the same common page |
