[INTRO] KeyValues Plugin

KeyValues Plugin

The “keyvalues” operator only works with DataTiddlers. Non data-tiddlers will be ignored!

keyvalues Operator

The keyvalues operator uses an extended syntax that permits multiple fields and flags to be passed:

[keyvalues:<field list>:<separator>:<flag>[<operand>]]
  • field list: an ordered, comma delimited list. Either key, value or both
    • defaults to key,value if blank
  • separator: a separator string used to combine the output string
    • defaults to : = <colon><space> if blank (new since V2.1.0)
    • If a space is needed, use: &nbsp;
    • If a colon : is needed, use: &#58;
  • flag: usekey, usevalue or useboth
    • (defaults to usekey if blank)
    • only 1 flag is allowed. The first one will be used
  • operand: filter operand

The following example lists both the key and the value. It uses the string -xx- as a separator between key and value. It uses the regexp operand: digit-pattern to filter by the key

<$set name="digit-pattern" value="[0][3-9]:">
[keyvalues:key,value:-xx-:usekey<digit-pattern>]

The available flags are:

  • usekey - the key will be used to filter the output. The <operand> contains a regexp filter
  • usevalue - the value will be used to filter the output. The <operand> contains a regexp filter
  • useboth - the key, the seperator and value will be used to filter the output. The <operand> contains a regexp filter

Demo

WikiLabs Suite

The WikiLabs Main Page gives an overview about all editions, plugins and themes.

There is an Introduction Video how to make the WikiLabs Plugin Library available in your own wikis, accessible from the ControlPanel → Plugins → Get More Plugins dialogue.

Show Screenshot

Code

About Open Source

Most open source software is free of charge and that’s a good thing! But that does not mean, that there are no costs for someone else to create, support and maintain it.

So if you use it: Support it!

Have fun!
Mario

6 Likes