Weighting system is frustrating...
Hey, I've been exploring the Drupal system for a site I'm developing and so far I like the modularity and think it might provide me with the flexibility we'll need. I have come across some minor issues that bother me... One in particular is that I find the weighting system to be incredibly frustrating.
In a system that has more than 21 items will the whole system would break down if you want rigid control over the sorting, or do the weighting limits automagically expand?
It seems to me items should have a "children-sort-method" property, where you would be able to specify something along the lines of alphabetical, reverse alphabetical, chronological, weighting, or manual.
Also, having to enter an item's property page just to set its weighting is counter-intuitive. The ordering interfaces should be available within the list view of the items. (ie. up & down 'buttons' for manual sorting, lighter & heavier or float & sink 'buttons' within the list view. Think admin/taxonomy: --item (edit, ↑ | ↓) )
I'm tempted to start looking into the code to try and figure out how implementable these ideas are, but I'm hardly the right person to be doing it at this point in time (given that I'd never even heard of Drupal two weeks ago). I am more than willing to help out, but I'll probably be more useful once I've worked with the code a little more.
Comments / discussion / dissension?

Filtering Has Been Discussed
But, seems to have no real solid solution. Perhaps we can get some straighter answers. Anyone?
-
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com
Filtering?
I don't understand how 'filtering' would address the issue I raised... Can you elaborate?
-
http://blog.apathyant.com | http://www.brentc.com
Bad Word Choice
I really should have said: "Sorting has been discussed." There seems to be some movement on how to sort nodes that are displayed either from A-Z/Z-A, or by date, or by title, etc.
-
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com
Weight system should be changed
And I think your way to go is way better than the current existing system. I think from what I read briefly on this site, the reason why they use weight number is so that they can do an ORDER BY on the weight column.
One can fake the system out by having drupal assign weights to a new node (so that the system knows how to adjust the weight numbers by the number of items that's there) The short coming is that when one orders the node using up or down arrow, one has to not only adjust that node's weight, it also have to shift the rest of the nodes down. (many SQL calls, not a great idea)
I think the only way to change it effectively is to have drupal change the way nodes are retrieved from the database. Instead of using a number to ORDER BY, they should order it in the PHP code, using a before and after node number.
Say if I want item "Bob" to be in the fifth place, right after "Nancy". I should record in the database that Bob is right after Nancy. If I want Bob to be the first one, I should be able to select on a menu, that Bob is after nothing. If I want Bob to be last, I should be able to select on a menu, Bob is last.
Then the code should perform a recursive subroutine to generate the list, starting with the node marked as First or After nothing. (Keep in mind that all the menu items should be retrieved already from the database, we're doing this in PHP code). The code should traverse through the recordset, find the first node, take note of the nid. Then traverse through the recordset again, searching for a node that is marked as after the first nid.
Again, sounds all good in logic, but we might have to change the way drupal retrieves the record set to begin with (should get rid of the ORDER BY), which is probably a bigger change than one thinks.
Not necessarily...
Actually, shifting values like this can actually be done relatively simply on a 'position' column by doing a single: UPDATE table SET [position/weight]=[position/weight]+1 WHERE foo=bar AND position > blah
Regardless, there's a reason for using DB queries to order results, since indexes usually make this sorting process very fast and efficient, where loading sets into php and then sorting can become combersome quickly.
Think about ordered items spread over pagination. If you're not ordering results until you pull all the data into php, you'll need to load the ENTIRE result set into PHP and then sort, just to find the small viewport of items you want to present on page x of y.
-
http://blog.apathyant.com | http://www.brentc.com
The present sytem would work
The present sytem would work better if you could enter your own numbers rather than follow after those drop downs. I think most users can count and sort up to a hundred fairly easily ;) the drop downs are just in the way.
---------------------------
Hivemindz CMSopedia
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
I would even go so far as to
I would even go so far as to say that the drop downs make weighting almost unusable. I feel embarrassed every time I use them. It's like having an eight-track player in a new shiny new car.
A short little textfield would be a vast improvement.
-zach
------------------------
harkey design
Hear hear
So what do we do? Submit some bug report?
It's not a bug, it's by design.
That some people don't like that design does not make it a bug. :)
If you want to change this in Drupal, then you must get involved in the Drupal 6 code now. You can do this by reviewing the patch/feature queue and submitting patches for the features requested. If such a feature does not already exist, then you can submit a feature request however, I suspect such a feature request already exists.
So if it exists, things to consider are how a different system would work. Any system must work first without the use of javascript. It can work better with JS, must must degrade gracefully. Please also be aware that the weight system is involved with more then just blocks but does in fact control a lot of other form display and module placement information so any proposed change should take care to include those in it's design considerations as well.
Best of luck and happy involvement.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
Take a look at biblio
Take a look at biblio module! The present system as such is ok with me, it's the drop boxes that annoys me. I'd rather enter my own number. Then I can leave gaps of say 10 or 100 between the sorted units initially, to leave from for inserting new stuff in between. Have a look at how weighting of fields is done in Biblio module. You just enter integers in plain text boxes, instead of dropdown select boxes.
Several options
I saw a while ago this link: http://www.acko.net/blog/drupal-weights but the examples are not active.
Some javascript options are:
http://www.nuff-respec.com/external/javascriptgui.html
http://www.codeproject.com/jscript/iliasorter.asp
Example:http://www.babailiica.com/js/sorter/
David McIntosh
neofactor.com
Better menu weight system, in AJAX
I have tackled the menu weight administration problem here, and have supplied draft-quality code should anyone be interested to try it out.
Help with "weighting" would indeed be good
I'm new to Drupal, used Mambo/Joomla.
Already seems to me that things could be better re weighting.
With Joomla, I can readily do manual sort order for listings of items in menus. (alphabetical or by date etc not really ideal)
Including it seems that when I have a set of menu items, if I want to rearrange them have to do so by individually choosing weights (and remembering what the weights are for the others). Easier if, say, could see list of all items, and change weights in this.
Had quick look at Halfer's page, and drag and drop idea seems nifty.
Nodeorder
See the Nodeorder module http://drupal.org/project/nodeorder, which works brilliantly
The problem (for me) is that the Image module does not yet support Nodeorder's method of ordering.
Regards
Tony Sleep http://tonysleep.co.uk
nodeorder, and 5
Thanks for letting this info: seems there are gazillions of modules, to perform all sorts of nifty tasks! (rather got my head swirling re possibilities with those I've collected so far)
Checking nodeorder, see it's for 4.7. Maybe by time I have enough content for this to be real concern for me, a version for 5 will be out too.
____________________________
CheungChauHK 長洲HK - South China Sea island in Hong Kong.
I've been using database
I've been using database systems and sorting routines for about 20 years now. Drupal is a tremendous piece of software, but the "weighing" as an ordering principle is just, umm, weird. I don't think many people want esoteric sorting routines, but there are some which should be considered standard by any database system: order by "author" (or submitter), by entering date, etc. Luckily, in the Views module, this can be accomplished quite easily. But in Drupal-out-of-the-box it's "date of entering" or "weighing", and that is simply not sufficient.
Ludo