The Meta Keys field allows you to add arbitrary pieces of information to entries identified by a user generated key. You can set default keys, and choose different output types by key or named key. It attempts to provide some handy filtering hooks for your datasources as well.
- Version: 1.0
- Date: 29th May 2012
- Requirements: Symphony 2.3 or newer, http://github.com/symphonycms/symphony-2/
- Author: Brendan Abbott, [email protected]
- GitHub Repository: http://github.com/brendo/field_metakeys
- Upload the
/field_metakeys
folder to your Symphony/extensions
folder. - Enable it by selecting the "Field: Meta Keys", choose Enable from the with-selected menu, then click Apply.
- You can now add the "Meta Keys" field to your Sections.
You can set a number of default keys in the Section Editor, these will appear when you first create an entry. You don't have to use them, they can be removed with the [x].
The usual Symphony validation applies to the Values of your Keys.
This makes sure that you have at least one completed Pair, that is, the Key and Value is filled.
You can choose between the named keys output, or just a generic key output for your XML. A named key will use the name of the key as the node name, whereas generic will just list each pair under a 'key' node.
Best efforts have been made for these to support normal Symphony enumerators of +
,,
and :
, but please report any unusual behaviour!
Normal default filtering without any *:
conditions will search on keys. This will return all the entries where a key of colour
exists (whether it has a value or not).
This will return all entries where one Pair exists that has the value of red.
This will return all entries where the Colour
key equals red
. You can chain this as well with key-equals: colour=red, shape=square
that will get all entries where the Colour
is red
and the Shape
is square
.
Since the 0.9.5
release, this Field now integrates with XMLImporter. It expects a comma delimited string, eg. red, square
. This will populate the first key with red
and the second key with square
.
If there are default keys, these will be pre-filled first. So if the Default Keys for my Meta Keys field were Colour, Shape
, the previous string would result in Colour: red, Shape: square
. If the string contained more values than keys, additional keys are named as Key $i
, where is $i
is the index. So red, square, $10.00
would result in Colour: red, Shape: square, Key 3: $10.00
.