|
2 | 2 | Customising Roundup |
3 | 3 | =================== |
4 | 4 |
|
5 | | -:Version: $Revision: 1.70 $ |
| 5 | +:Version: $Revision: 1.71 $ |
6 | 6 |
|
7 | 7 | .. This document borrows from the ZopeBook section on ZPT. The original is at: |
8 | 8 | http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
@@ -1247,32 +1247,58 @@ _value the value of the property if any - this is the actual value |
1247 | 1247 |
|
1248 | 1248 | There are several methods available on these wrapper objects: |
1249 | 1249 |
|
1250 | | -=========== ================================================================= |
1251 | | -Method Description |
1252 | | -=========== ================================================================= |
1253 | | -plain render a "plain" representation of the property |
1254 | | -field render an appropriate form edit field for the property - for most |
1255 | | - types this is a text entry box, but for Booleans it's a tri-state |
1256 | | - yes/no/neither selection. |
1257 | | -stext only on String properties - render the value of the |
1258 | | - property as StructuredText (requires the StructureText module |
1259 | | - to be installed separately) |
1260 | | -multiline only on String properties - render a multiline form edit |
1261 | | - field for the property |
1262 | | -email only on String properties - render the value of the |
1263 | | - property as an obscured email address |
1264 | | -confirm only on Password properties - render a second form edit field for |
1265 | | - the property, used for confirmation that the user typed the |
1266 | | - password correctly. Generates a field with name "name:confirm". |
1267 | | -reldate only on Date properties - render the interval between the |
1268 | | - date and now |
1269 | | -pretty only on Interval properties - render the interval in a |
1270 | | - pretty format (eg. "yesterday") |
1271 | | -menu only on Link and Multilink properties - render a form select |
1272 | | - list for this property |
1273 | | -reverse only on Multilink properties - produce a list of the linked |
1274 | | - items in reverse order |
1275 | | -=========== ================================================================= |
| 1250 | +========= ===================================================================== |
| 1251 | +Method Description |
| 1252 | +========= ===================================================================== |
| 1253 | +plain render a "plain" representation of the property. This method may |
| 1254 | + take two arguments: |
| 1255 | + |
| 1256 | + escape |
| 1257 | + If true, escape the text so it is HTML safe (default: no). The |
| 1258 | + reason this defaults to off is that text is usually escaped |
| 1259 | + at a later stage by the TAL commands, unless the "structure" |
| 1260 | + option is used in the template. The following are all equivalent:: |
| 1261 | + |
| 1262 | + <p tal:content="structure python:msg.content.plain(escape=1)" /> |
| 1263 | + <p tal:content="python:msg.content.plain()" /> |
| 1264 | + <p tal:content="msg/content/plain" /> |
| 1265 | + <p tal:content="msg/content" /> |
| 1266 | + |
| 1267 | + Usually you'll only want to use the escape option in a complex |
| 1268 | + expression. |
| 1269 | + |
| 1270 | + hyperlink |
| 1271 | + If true, turn URLs, email addresses and hyperdb item designators |
| 1272 | + in the text into hyperlinks (default: no). Note that you'll need |
| 1273 | + to use the "structure" TAL option if you want to use this:: |
| 1274 | + |
| 1275 | + <p tal:content="structure python:msg.content.plain(hyperlink=1)" /> |
| 1276 | + |
| 1277 | + Note also that the text is automatically HTML-escape before the |
| 1278 | + hyperlinking transformation. |
| 1279 | + |
| 1280 | +field render an appropriate form edit field for the property - for most |
| 1281 | + types this is a text entry box, but for Booleans it's a tri-state |
| 1282 | + yes/no/neither selection. |
| 1283 | +stext only on String properties - render the value of the |
| 1284 | + property as StructuredText (requires the StructureText module |
| 1285 | + to be installed separately) |
| 1286 | +multiline only on String properties - render a multiline form edit |
| 1287 | + field for the property |
| 1288 | +email only on String properties - render the value of the |
| 1289 | + property as an obscured email address |
| 1290 | +confirm only on Password properties - render a second form edit field for |
| 1291 | + the property, used for confirmation that the user typed the |
| 1292 | + password correctly. Generates a field with name "name:confirm". |
| 1293 | +reldate only on Date properties - render the interval between the |
| 1294 | + date and now |
| 1295 | +pretty only on Interval properties - render the interval in a |
| 1296 | + pretty format (eg. "yesterday") |
| 1297 | +menu only on Link and Multilink properties - render a form select |
| 1298 | + list for this property |
| 1299 | +reverse only on Multilink properties - produce a list of the linked |
| 1300 | + items in reverse order |
| 1301 | +========= ===================================================================== |
1276 | 1302 |
|
1277 | 1303 | The request variable |
1278 | 1304 | ~~~~~~~~~~~~~~~~~~~~ |
|
0 commit comments