internal package
Foswiki::Render::Zones
Support for rendering anchors. Objects of this class represent
a set of generated anchor names, which must be unique in a rendering
context (topic). The renderer maintains a set of these objects, one
for each topic, to ensure that anchor names are not re-used.
ClassMethod
new()
Construct a new zones set.
ObjectMethod
finish()
Break circular references.
ObjectMethod
addToZone($zone, $id, $data, $requires)
Add
$data
identified as
$id
to
$zone
, which will later be expanded (with
renderZone() - implements
%RENDERZONE%
).
$ids
are unique within
the zone that they are added - dependencies between
$ids
in different zones
will not be resolved, except for the special case of
head
and
script
zones
when
{MergeHeadAndScriptZones}
is enabled.
In this case, they are treated as separate zones when adding to them, but as
one merged zone when rendering, i.e. a call to render either
head
or
script
zones will actually render both zones in this one call. Both zones are undef'd
afterward to avoid double rendering of content from either zone, to support
proper behaviour when
head
and
script
are rendered with separate calls even
when
{MergeHeadAndScriptZones}
is set. See
ZoneTests/explicit_RENDERZONE*.
This behaviour allows an addToZone('head') call to require an id that has been
added to
script
only.
-
$zone
- name of the zone
-
$id
- unique identifier
-
$data
- content
-
$requires
- optional, comma-separated string of $id
identifiers that should precede the content
Note: Read the developer supplement at Foswiki:Development.AddToZoneFromPluginHandlers
if you are calling addToZone()
from a rendering or macro/tag-related plugin handler
Note: Macros will be expanded in all zones. TML markup will not be expanded
in the head
and scripts
zones. Any formatting in head
and scripts
zones
including [[TML links]] must be done directly using HTML. TML pseudo-tags like
nop
. verbatim
, literal
. and noautolink
are removed from head
and script
zones and have no influence on the markup.
All other zones will be rendered as a normal topic.
Implements
%ADDTOZONE%
.