For the life of me I cannot figure out how to reorder multivalue fields.

I have an image field on a product that can contain many images.
When the images were uploaded they were uploaded in no particular order, but now we wish to ensure that the main image of the product is displayed in views etc.

I thought I could do this by implementing the hook_load or hook_nodeapi or similar and rearranging the imagefield as it is loaded (for the time being just by sorting the alt tags).

This works when viewing the product itself, but not when the product is viewed in views etc.

I am looking for some fool proof way of ensuring that when the field is assigned to the node, I can rearrange it.
But for the life of me I cannot find a hook that is called at this stage.

Please please help.

Comments

karens’s picture

Status: Active » Fixed

You cannot control the order that multiple value fields are actually stored in the node in D5, this is fixed in D6 where you can re-arrange them any way you want. In D5, they will remain in the order you originally input them and if you have empty values in the middle, the empty values will get dropped, so your first item will always remain first.

In both D5 and D6 you have control over which image to display in Views. In D5 you can specify the first or last item, in D6 you can specify any of them.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.