This is an old revision of the document!
Table of Contents
COMMON_PAGETPL_LOAD
- Description:
- enhance or replace namespace templates
- DefaultAction:
- find a namespace template, load it and run pattern replacements on it
- Preventable:
- yes
- Added:
- 2011-02-03
This event is signaled by pageTemplate() in inc/common.php when a new page is to be created (loaded into the editor), handlers can use it to load their own namespace templates or manipulate loaded data before being used by the editor.
Plugins usually want to intercept the BEFORE event. If your plugin sets either the tpl
or the tplfile
info, the usual template lookup will be skipped and your provided data will be used. Setting doreplace
to false will skip the pattern replacements.
Intercepting the AFTER event will give you access to the template data after replacements have been done.
Passed Data
- $data['id']: The ID of the new page
- $data['tpl']: The page template content (empty in BEFORE)
- $data['tplfile']: The page template to load (empty in BEFORE)
- $data['doreplace']: Shall pattern replacements be used (defaults to true)
Plugins handling this event
The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself.
See also
- This event replaces HTML_PAGE_FROMTEMPLATE and COMMON_PAGE_FROMTEMPLATE