About
A metadata is a renderer type (parsing mode) that is used to create metadata.
See:
Articles Related
Type
Internally DokuWiki maintains two arrays of metadata
- current (current metadata should only be set in the context of the renderer as it will be overwritten the next time metadata is rendered)
- persistent. (The persistent array holds duplicates of those key/values which should not be cleared during the rendering process.)
If you want to create logic that persists:
- only in the scope of a session (example, add a library at the end of a template if a syntax is present): use current
- for all scope that is data dependent: use persistent
Management
Start
Metadata: The metadata rendering is only started by the p_get_metadata() and p_set_metadata().
with the render option possible values:
- METADATA_RENDER_USING_CACHE (default)
- METADATA_DONT_RENDER,
- METADATA_RENDER_USING_SIMPLE_CACHE,
- METADATA_RENDER_UNLIMITED (also combined with the previous two options),
Set
Persisent:
- renderer→persistent
- p_set_metadata set metadata.
Current:
- renderer→meta
Example
global $ID
p_set_metadata(
$ID,
array($key => $value),
$render = false,
$persistent = true
);
Event
https://www.dokuwiki.org/devel:event:parser_metadata_render - Signalled by p_render_metadata() in inc/parserutils.php before instantiating the metadata renderer.
Get
To get persistent metadata
- or the array renderer→persistent
To get volatile meta:
- renderer→meta
Update
Metadata update happens asynchronously via the taskrunner
The task runner is located in lib/exe/taskrunner.php and is included as hidden image by the tpl_indexerWebBug() function.