| 1 | %META:TOPICINFO{author="ProjectContributor" date="1266225040" format="1.1" version="1.1"}% |
|---|
| 2 | %META:TOPICPARENT{name="Macros"}% |
|---|
| 3 | #VarRENDERZONE |
|---|
| 4 | ---+++ RENDERZONE |
|---|
| 5 | |
|---|
| 6 | <verbatim class="tml"> |
|---|
| 7 | %RENDERZONE{"zone" ...}% |
|---|
| 8 | </verbatim> |
|---|
| 9 | See [[VarADDTOZONE][ADDTOZONE]] for an explanation of _zones_. |
|---|
| 10 | |
|---|
| 11 | Parameters: |
|---|
| 12 | * ="zone"= required, name of the zone |
|---|
| 13 | * =header="..."= optional, prefix format string |
|---|
| 14 | * =format="..."= optional, format string for each item added to the zone, defaults to =$item=. Tokens: |
|---|
| 15 | * =$id= - =id= of the [[VarADDTOZONE][ADDTOZONE]] call within the =zone= currently being rendered. |
|---|
| 16 | * =$item= - text of the [[VarADDTOZONE][ADDTOZONE]] call within the =zone= currently being rendered. |
|---|
| 17 | * =$zone= - the ="zone"= currently being rendered. |
|---|
| 18 | * =$missing= - if the [[VarADDTOZONE][ADDTOZONE]] call being rendered required any =id= which was not found, then =$missing= is the =missingtoken= parameter; empty string otherwise. |
|---|
| 19 | * =$missingids= - comma separated list of ids that were required by the [[VarADDTOZONE][ADDTOZONE]] call currently being rendered but weren't found within this =zone=. |
|---|
| 20 | * =missingtoken="..."= optional, this will be the string assigned to the =$missing= format token for use in the =format= parameter. Defaults to ="$missingids"= |
|---|
| 21 | * =chomp="on"= remove leading and trailing whitespace from formatted items, can be useful for pretty-printing and compression. |
|---|
| 22 | * =footer="..."= optional, suffix format string |
|---|
| 23 | * =separator="..."= optional, put between each item of a zone |
|---|
| 24 | |
|---|
| 25 | Supports the [[FormatTokens][standard format tokens]] in the =format= and =separator= (but *not* in the =header= or =footer=). |
|---|
| 26 | |
|---|
| 27 | =header= and =footer= are output irrespective of whether there is any content |
|---|
| 28 | in the zone or not. |
|---|
| 29 | |
|---|
| 30 | =head= and =body= are _built-in_ zones - there is no corresponding =RENDERZONE= |
|---|
| 31 | required in the templates, they will be rendered automatically. |
|---|
| 32 | |
|---|
| 33 | %ICON{"info"}% Zones are flushed when rendered; they may only be rendered once |
|---|
| 34 | |
|---|
| 35 | See also [[VarADDTOZONE][ADDTOZONE]] for more information on zones. |
|---|