Hi!
I'm in need of a certain feature wich I haven't found present in the modules (but it still could be there and it's me that can't see it).
I want to implement a content type with a CCK field which holds a list of participants, which should be then displayed in alphabetical order.
A multiple valued text field is not enough: first, the fact that you have to save the node and update it again for every three entries you make is not really comfortable, exspecially if there are lot of participants to add to a particular node. Secondly i guess the values would be saved in the db in the order in which they are added, and as far as my drupal knowledge goes, I wuold be able to sort them just when outputted, and it would be done at each loading of the page cointaining the node... does not seem really efficient.
Any ideas? The only one I had involved the elements of the list being themselves nodes, but it seemed too troublesome (and it certainly did not solve point 2 above) so I dropped it.
Comments
It's hard to say without
It's hard to say without knowing exactly what you are trying to do but:
Drupal stores data in the order you create it. That means that if you want to do any kind of sort, it would have to be performed either at the database query level, or between the query level and the display. This is what views does at the node level. If you want a general sort functionality, you would have to create a module. But, if you want this functionality for a particular view, say, in the content input form, then you should be able to create your own template.php for the edit form for a specific content type which will sort, by however you want, the returned values of a particular field, fields, or group of fields.
..
this thread might help you in the right direction.
http://drupal.org/node/85806
Phil
thanks
Thanks, but the point here is that the information I want to include to a node is so basic (just textfields) I would not rather use actual nodes to handle them, also because it's information strictly related to a single node, whereas nodes are quite global. It would be like using a jcb to eat ;)
What I'm thinking of is a field: upon creation of the node you may put various values in this field (possibly without the annoying three values at a time limit), and this should be stored as an ordered array (the type of order should be selectable at field type creation time). So the sorting would be done at node creation time before storing the values in the db, or when updating the node. Multiple valued fields already store info in arrays, I'd just want: a better way to input them, and sorting to be done at creation time.
Now that I phrased and also thought about what I'd like more precisely, maybe I can post it as a request in the CCK issues...