Skip to content

Instantly share code, notes, and snippets.

@brendo
Created September 4, 2010 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendo/564836 to your computer and use it in GitHub Desktop.
Save brendo/564836 to your computer and use it in GitHub Desktop.
Musings about a new Symphony extension

A Meta Keys field allows you to add arbitrary pieces of information to entries identified by a user generated key. The interface resembles the section editor in that any number of keyed information could be added to an entry (interface possibly provided by the Stage extension).

The values would always be text (at least initially).

For instance, a Meta Keys field could be added to a Products entry and then filled with this data:

  • Colour: Red
  • Size: 500ml

A datasource could then filter on the keys (in a yet to be determined syntax), eg. color=red.

The XML output would be normalised for xpath:

<meta-keys>
    <key name='Colour' handle='colour'>
        <value handle='red'>Red</value>
    </key>
    <key name='Size' handle='size'>
        <value handle='500ml'>500ml</value>
    </key>
</meta-keys>

Parameter output could be tricky, possibly just let it output the values of the keys for now.

This field would disallow prePopulate (eg. a SBL field couldn't link to it)

The field would not be orderable.

The publish index representation of the field would be a list of key names (has more context then 'Red' or '500ml')

The field settings would allow you to create default key's so on the creation of new entries you would already have some prefilled (but empty) keys. Wonder whether it'd be best (on the new/edit forms) to just prefill the actual field, or again keep with the section editor interface in that you can select a key from a dropdown and then 'add' this to field.

Setting the field as required would just check that at least one key/value pair is provided.

Validator rules would apply to the values of the field.

Aiming for Symphony 2.1 compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment