|
2 | 2 | Customising Roundup |
3 | 3 | =================== |
4 | 4 |
|
5 | | -:Version: $Revision: 1.93 $ |
| 5 | +:Version: $Revision: 1.93.2.1 $ |
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 |
@@ -1473,65 +1473,68 @@ _value the value of the property if any - this is the actual |
1473 | 1473 |
|
1474 | 1474 | There are several methods available on these wrapper objects: |
1475 | 1475 |
|
1476 | | -========= ================================================================ |
| 1476 | +=========== ================================================================ |
1477 | 1477 | Method Description |
1478 | | -========= ================================================================ |
1479 | | -plain render a "plain" representation of the property. This method |
1480 | | - may take two arguments: |
1481 | | - |
1482 | | - escape |
1483 | | - If true, escape the text so it is HTML safe (default: no). The |
1484 | | - reason this defaults to off is that text is usually escaped |
1485 | | - at a later stage by the TAL commands, unless the "structure" |
1486 | | - option is used in the template. The following ``tal:content`` |
1487 | | - expressions are all equivalent:: |
1488 | | - |
1489 | | - "structure python:msg.content.plain(escape=1)" |
1490 | | - "python:msg.content.plain()" |
1491 | | - "msg/content/plain" |
1492 | | - "msg/content" |
1493 | | - |
1494 | | - Usually you'll only want to use the escape option in a |
1495 | | - complex expression. |
1496 | | - |
1497 | | - hyperlink |
1498 | | - If true, turn URLs, email addresses and hyperdb item |
1499 | | - designators in the text into hyperlinks (default: no). Note |
1500 | | - that you'll need to use the "structure" TAL option if you |
1501 | | - want to use this ``tal:content`` expression:: |
1502 | | - |
1503 | | - "structure python:msg.content.plain(hyperlink=1)" |
1504 | | - |
1505 | | - Note also that the text is automatically HTML-escaped before |
1506 | | - the hyperlinking transformation. |
1507 | | - |
1508 | | -field render an appropriate form edit field for the property - for |
1509 | | - most types this is a text entry box, but for Booleans it's a |
1510 | | - tri-state yes/no/neither selection. |
1511 | | -stext only on String properties - render the value of the property |
1512 | | - as StructuredText (requires the StructureText module to be |
1513 | | - installed separately) |
1514 | | -multiline only on String properties - render a multiline form edit |
1515 | | - field for the property |
1516 | | -email only on String properties - render the value of the property |
1517 | | - as an obscured email address |
1518 | | -confirm only on Password properties - render a second form edit field |
1519 | | - for the property, used for confirmation that the user typed |
1520 | | - the password correctly. Generates a field with name |
1521 | | - "name:confirm". |
1522 | | -now only on Date properties - return the current date as a new |
1523 | | - property |
1524 | | -reldate only on Date properties - render the interval between the date |
1525 | | - and now |
1526 | | -local only on Date properties - return this date as a new property |
1527 | | - with some timezone offset |
1528 | | -pretty only on Interval properties - render the interval in a pretty |
1529 | | - format (eg. "yesterday") |
1530 | | -menu only on Link and Multilink properties - render a form select |
1531 | | - list for this property |
1532 | | -reverse only on Multilink properties - produce a list of the linked |
1533 | | - items in reverse order |
1534 | | -========= ================================================================ |
| 1478 | +=========== ================================================================ |
| 1479 | +plain render a "plain" representation of the property. This method |
| 1480 | + may take two arguments: |
| 1481 | + |
| 1482 | + escape |
| 1483 | + If true, escape the text so it is HTML safe (default: no). The |
| 1484 | + reason this defaults to off is that text is usually escaped |
| 1485 | + at a later stage by the TAL commands, unless the "structure" |
| 1486 | + option is used in the template. The following ``tal:content`` |
| 1487 | + expressions are all equivalent:: |
| 1488 | + |
| 1489 | + "structure python:msg.content.plain(escape=1)" |
| 1490 | + "python:msg.content.plain()" |
| 1491 | + "msg/content/plain" |
| 1492 | + "msg/content" |
| 1493 | + |
| 1494 | + Usually you'll only want to use the escape option in a |
| 1495 | + complex expression. |
| 1496 | + |
| 1497 | + hyperlink |
| 1498 | + If true, turn URLs, email addresses and hyperdb item |
| 1499 | + designators in the text into hyperlinks (default: no). Note |
| 1500 | + that you'll need to use the "structure" TAL option if you |
| 1501 | + want to use this ``tal:content`` expression:: |
| 1502 | + |
| 1503 | + "structure python:msg.content.plain(hyperlink=1)" |
| 1504 | + |
| 1505 | + Note also that the text is automatically HTML-escaped before |
| 1506 | + the hyperlinking transformation. |
| 1507 | +hyperlinked The same as msg.content.plain(hyperlink=1), but nicer:: |
| 1508 | + |
| 1509 | + "structure msg/content/hyperlinked" |
| 1510 | + |
| 1511 | +field render an appropriate form edit field for the property - for |
| 1512 | + most types this is a text entry box, but for Booleans it's a |
| 1513 | + tri-state yes/no/neither selection. |
| 1514 | +stext only on String properties - render the value of the property |
| 1515 | + as StructuredText (requires the StructureText module to be |
| 1516 | + installed separately) |
| 1517 | +multiline only on String properties - render a multiline form edit |
| 1518 | + field for the property |
| 1519 | +email only on String properties - render the value of the property |
| 1520 | + as an obscured email address |
| 1521 | +confirm only on Password properties - render a second form edit field |
| 1522 | + for the property, used for confirmation that the user typed |
| 1523 | + the password correctly. Generates a field with name |
| 1524 | + "name:confirm". |
| 1525 | +now only on Date properties - return the current date as a new |
| 1526 | + property |
| 1527 | +reldate only on Date properties - render the interval between the date |
| 1528 | + and now |
| 1529 | +local only on Date properties - return this date as a new property |
| 1530 | + with some timezone offset |
| 1531 | +pretty only on Interval properties - render the interval in a pretty |
| 1532 | + format (eg. "yesterday") |
| 1533 | +menu only on Link and Multilink properties - render a form select |
| 1534 | + list for this property |
| 1535 | +reverse only on Multilink properties - produce a list of the linked |
| 1536 | + items in reverse order |
| 1537 | +=========== ================================================================ |
1535 | 1538 |
|
1536 | 1539 |
|
1537 | 1540 | The request variable |
|
0 commit comments