We have a metadata schema using a metadata select field and have added new keys and values overtime.
What easy and safe tricks to reorder them so the full list is in alphabetical order do people use?
We have a metadata schema using a metadata select field and have added new keys and values overtime.
What easy and safe tricks to reorder them so the full list is in alphabetical order do people use?
If you just want to re-order them I’d just go to the details screen and manually put them in the order they need to be. Once you’ve done that users will instantly see the new order when they interact with the field when editing page’s metadata.
That works… but it’s painful with a long list dragging 3 entries starting with C or D up through the alphabet for a long list(c.f. http://www.waikato.ac.nz/staff-profiles/categories)
A simple ‘resort alphabetically’ button feature would be ideal, but perhaps gets overlooked alongside other feature requests?
Hi
Another option might be to use a local csv file (sort in Excel etc) then upload this. Might be quicker then manually re-ordering for a long list with lots of new entries.
Don’t think this affects any existing metadata values as long as all the existing key/values are the same.
Thanks
Peter
Correct what Peter said, I’d do that to.
AFAIK there has never been a feature request to enable this automatic sorting function before.
Hi
You would need to create it yourself…
For example, to save some time you could run a script similar to below in your browser console to generate it.
var csv = "";
$("#metadata_field_select_<your_metadata_field_id> option").each(function() {
csv += $(this).val() + "," + $(this).text() + "\n";
});
var newWindow = window.open("", "CSV", "scrollbars=yes, resizable=yes");
newWindow.document.body.innerHTML = "<textarea>" + csv + "</textarea>";
Just open to the admin view of an asset that uses this field and get its id, and run the script. It will output value and key pairs to a textarea in a new window. Can save the data as a csv file.
Might need to adjust the script (eg encasing the data n quotes) depending on your requirements.
Thanks
Peter
I’ve created a squizmap idea for some of the things discussed here - https://squizmap.squiz.net/matrix/10001
My feeling is this should be a non trivial task, without having to resort to albeit clever javascript hacks or manual processing.