0 users online. Create an account or sign in to join them.Users
This is an open discussion with 23 replies, filed under Extensions.
A new extension, "Meta Keys" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.
And the README:
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.
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.
key-equals: colour=red, shape=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 prefilled 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.
Colour: red, Shape: square
red, square, $10.00
Colour: red, Shape: square, Key 3: $10.00
0.9.5 (22nd November 2011)
0.9.4 (27th September 2011)
0.9.3 (9th March 2011)
0.9.2 (15th December 2010)
0.9.1 (10th November 2010)
0.9 (11th October 2010)
@brendo, very cool.
Would you mind sharing with us an example on how you use this extension?
An example I thought of would be an e-commerce store where all Products have a varied set of information.
Most might have a Size & Colour, so I could set them as Default Keys, but then depending on the product they might then have a Weight or Dimensions.
Instead of just having creating multiple fields for each of the ‘possible’ keys, this extension allows you to just define what you need for that entry.
Admittedly, it does break the Symphony flow a bit, because there would be nothing stopping someone from using this field soley to hold all entry data instead of creating multiple fields, but I still think it has it’s uses and would come in handy :)
Definitely something that would be useful!
We recently built a service where authors are able to choose the skin for their personal page. A textarea with json encoded data was used as it was simple and straightforward, but we might seriously consider switching to Meta Keys because it seems the perfect fit. Thanks :)
Great idea, brendo!
This is really interesting, Brendan! Implementing a faceted classification is going to be a lot easier :)
I'm trying to use this extension to allow an arbitrary "credits" field on a video portfolio. The credits are arbitrary, so this field would be the perfect solution. However, I get a fatal database error when trying to save an entry with a Meta Keys field. See below (I changed the key/value names to generic ones for privacy):
Unknown column 'sortorder' in 'field list'
An error occurred while attempting to execute the following query
INSERT INTO sym_entries_data_11 (entry_id, key_handle, key_value, value_handle, value_value, sortorder) VALUES ('2', 'director', 'Director', 'joe-chang', 'Joe Chang', '1')
I've also reported this issue to the tracker. Any insight?
Apologies, I was looking at making the keys sortable on the backend and that must of slipped through the cracks when I reverted it.
Pull from master, it’s been fixed :)
Haha, bad extension-adding timing for the win!
Meta Keys updated to version 0.9.1 on 10th of November 2010
10th of November 2010
Wow, this looks great brendo.
I have been running into this issue building shops which need products with variable details, thanks a lot.
Meta Keys updated to version 0.9.2 on 15th of December 2010
15th of December 2010
Meta Keys updated to version 0.9.3 on 9th of March 2011
9th of March 2011
I sent you a pull request which fixes/adds the following:
Meta Keys updated to version 0.9.4 on 27th of September 2011
27th of September 2011
Meta Keys updated to version 0.9.5 on 22nd of November 2011
22nd of November 2011
I am getting some unexpected behaviour when trying to chain filters together. I am trying to do:
manufacturer=bosch AND bulb-shape=round
when I do :
key-equals: manufacturer=bosch, bulb-shape=round
I get results with manufacturer=bosch OR bulb-shape=round
I get the same results for:
key-equals: manufacturer=bosch + bulb-shape=round
Am I doing something wrong?
Am I doing something wrong?
Not really, I've never tested for chaining filters so I'm unsure of if it's supported or not.
You could try key-equals: manufacturer=bosch + key-equals: bulb-shape=round, but if that doesn't work can you add it as an issue to Github and I'll have a closer look into it :)
key-equals: manufacturer=bosch + key-equals: bulb-shape=round
Meta Keys updated to version 1.0 on 7th of June 2012
7th of June 2012
Any way to import entries with key and value using XML Importer ?
I mean not using default keys, but something like
I need to set the key name so I can filter things and compare entries.
Create an account or sign in to comment.
Contact the team
Symphony • Open Source XSLT CMS