Table of Contents
Custom Meta Plugin
Compatible with DokuWiki
- 2024-02-06 "Kaos" yes
- 2023-04-04 "Jack Jackrum" unknown
- 2022-07-31 "Igor" unknown
- 2020-07-29 "Hogfather" unknown
Similar to meta, metaeditor
Description
This is a very basic plugin that allows adding custom metadata to a wiki page. This plugin (currently) does NOT interact with native metadata used by DokuWiki or metadata added by other plugins.
The metadata to be added must be declared using a specific syntax in the page text. The declaration supports both visible and invisible modes. In visible mode, the declared value will be present and readable as part of the page content. In invisible mode, the declaration will be hidden.
The plugin allows you to define whether the metadata should be stored as a string (default), integer, or a UNIX timestamp.
All added metadata will be appended to the page's .meta file within an array called “custommeta.” This prevents any modifications made by this plugin from interfering with the metadata used by DokuWiki or other plugins.
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Syntax/Examples/Usage
The declaration starts and ends with two plus signs '++'. Depending on the mode, following the opening '++', we declare “CMV:” (custom meta visible) or “CMI:” (custom meta invisible). After that, we add the “key:value” pair that we want to store. Optionally before the final '++', we can add “:i” (interger) or “:d” (UNIX timestamp) to indicate the data type to be used when storing the metadata.
Visible Mode:
Add the key “status” with the value “complete” to the page's metadata. The text “complete” will be visible when reading the page.
++CMV:status:complete++
Invisible Mode:
Add the key “class” with the value “magazine” to the page's metadata.The entire declaration will be hidden from the readable version of the page.
++CMI:class:magazine++
Data types:
By default, all values are stored as strings without being manipulated.
Use “:i” after the value to store it as an integer in the metadata.
++CMV:population:10800:i++
Use “:d” after the value to store it as an UNIX timestamp in the metadata. NOTE: The DateTime() functionality in PHP is used to convert the date string to UNIX time. Therefore, this format of dates and times must be used.
++CMI:release:2020-03-10:d++
Full example:
====== Frederik ====== He loves mountaineering. He is interested in working on open source projects. Lives in: ++CMV:country:chile++ Age: ++CMV:age:30:i++ End of text. ++CMI:reviwed:2024:10:09:d++
Motivation
This plugin arises from two motivations. The first is that the other two available plugins that can interact with page metadata have, to varying degrees, errors that make them unstable. Secondly, this plugin is designed to be used with a fork I created of pagelist. In this fork, I have added the functionality to add custom columns to the tables generated by the plugin and fill them with information from the metadata of the listed pages (image).