source: trunk/core/data/System/VarRENDERZONE.txt @ 8298

Revision 8298, 2.0 KB checked in by PaulHarvey, 3 years ago (diff)

Item9317: 3-line ADDTOZONE fix ended up being a lot bigger than intended

  • body zone is now an alias to head zone when not {OptimizePageLayout}
  • Renamed some vars and methods, because they seemed a little opaque.
  • Rename tag parameter to id (tag is still supported, undocumented)
  • Added a new parameter, missingtoken, which dictates the output of a new format token: $missing. This adds information in the <!-- $id --> decoration that's appended after each ADDTOZONE's content if there were required ids that could not be found.
  • Adjusted docs, probably too much.
  • Added some tests.
Line 
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>
9See [[VarADDTOZONE][ADDTOZONE]] for an explanation of _zones_.
10
11Parameters:
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
25Supports 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
28in the zone or not.
29
30=head= and =body= are _built-in_ zones - there is no corresponding =RENDERZONE=
31required in the templates, they will be rendered automatically.
32
33%ICON{"info"}% Zones are flushed when rendered; they may only be rendered once
34
35See also [[VarADDTOZONE][ADDTOZONE]] for more information on zones.
Note: See TracBrowser for help on using the repository browser.