Forum OpenACS Q&A: Re: sort_order / sort_key - Moving objects up and down a list

To use cr_child_rels to order a specific content_type it would probably be useful to create a view that would return the items in the proper order based on the parent.

This would be very useful if, for example you have an article with 3 related images. The editor could change the order the images appear with that article.

Then some or all of those images could also be related to another article with a different order.

The cr_child_rels method might be more complex, but offers the best flexibility. I agree that it is a good idea to improve the API to manage this and the rest of the features of the content repository.

Ola,

If you aren't using the CR you have two options, i think. Put an explicit sort_order in your items table if the items will only be ordered one way. Otherwise you need a mapping table that contains a parent_id and sort_order. You could use acs_rels or a custom mapping table.