By pshafer on
I'm writing my first CCK field and I was wondering if there was any way that I can apply a display order for multiple values? I tried using the column in my field called display_order and making the input form field for that column a '#weight' field from the form api. However this had no effect on the order in which the elements were queried.
Does anyone have suggestions?
Comments
...
(Note that in Drupal 6's CCK there's already a UI to control the order of 'multiple' fields. So one solution is to migrate to D6.)
A '#weight' field is just a selectbox. It contains no magic, so nothing useful is supposed to happen.
===
hook_widget()'s 'process form values' is the place where you hand your data to CCK. It's the $items array. You can sort it however you which before handing it to CCK, so your problem is solved here.