|
|
|||||||||||||||||||||||||||||
![]() |
ZonePluginChanged by WikiGuest on 28 Mar 2010 - 14:31 - r1
Gather content of a page in named zones while rendering it
The primary purpose of ZonePlugin is to streamline the anatomy of a HTML page in a way to allow today's browsers to process it more efficiently. Page loading time has been reported to decrease significantly when all JavaScript files are removed from the HEAD element and appended to the end of the BODY element of a page. That's because the browser will stop processing a page as soon as a JavaScript file is found in the linear order of the page. The browser will only proceed after this file has been downloaded and excecuted. Notably other content like CSS files and image material will not be downloaded in parallel as long as the JavaScript interpreter hasn't finished.
Currently, Foswiki uses ADDTOHEAD to place additional CSS and JS files into the
HEAD element. It does not reorder those files in any way other than specified
by the explicit
By using ADDTOZONE CSS and JS material can be added to the resulting page
incrementally while the core engine parses templates and wiki applications.
ADDTOZONE's first parameter is the name of the zone to add stuff to. There are
two special zones: The actual location of a zone is specified with an explicit RENDERZONE macro. This macro expands to the content of all material that has been posted to the named zone. Note, that this happens at the very end of the rendering pipeline of Foswiki. That means RENDERZONE is not processed as a normal macro obeying the evaluation order of the TML parser. Instead, all calls to ADDTOZONE are processed by the TML parser first after which all zones are expanded.
If RENDERZONE{head} and RENDERZONE{body} aren't found in the final page
explicitly, they are expanded at the appropriate position, that is at
The features of this plugin have been proposed as a core feature for Foswiki to replace the standard ADDTOHEAD with the more generic ADDTOZONE tag. This plugin allows authors of extensions and wiki applications to make use of this advanced feature in a backwards-compatible way. As soon as the ADDTOZONE macro has been released as part of newer Foswiki versions, this plugin won't be of use anymore.
WARNING: Using this plugin can potentially break your installation.
If you experience occasional JavaScript errors, switch off
In any case is it recommended to use
If you rely on having JavaScript added to the
page without using
ZonePlugin will try to detect whether any use of ADDTOHEAD contains
SyntaxADDTOZONE
%ADDTOZONE{ "zone" ... }%
Note, that using %ADDTOZONE{ "myzone" text="$percntINCLUDE{\"topic\" section=\"section\" warn=\"off\"}$percnt" }%
See also VarRENDERZONE RENDERZONE
%RENDERZONE{"zone" ...}%
Note, that you can create as many zones as you like. The plugin does not restrict you to use it only for
See also VarADDTOZONE
Perl API
This plugin patches the
The latter will try to detect
Any use of
Installation InstructionsYou do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server. Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in
DBCachePlugin: ZonePlugin not found
![]() |