Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello. I have problem with sort nodes by nodequeue position and date.
I want to display 20 nodes. Display 5 first nodes ordered by nodequeue position and 15 next nodes ordered by date.
I wrote a handler that solves this problem. I am sure that it will be useful to many people.
Just for example look at screenshots:
By default http://i.imgur.com/7hHv8.png
With my handler http://i.imgur.com/wrCOI.png
Comments
Comment #1
eugene.ilyin CreditAttribution: eugene.ilyin commentedPatch
Comment #2
eugene.ilyin CreditAttribution: eugene.ilyin commentedComment #3
eugene.ilyin CreditAttribution: eugene.ilyin commentedIf this patch is usefull for you, please add me as author of commit of this patch. It's very important for me, thanks!
Comment #4
amateescu CreditAttribution: amateescu commentedThis seems like a nice use-case and solution, but it took me a while to figure out what was the problem that you were trying to solve :) This is only useful if you don't restrict the view to nodes that are in a queue, right?
Could you improve the text (help, title) in the patch to reflect this? And maybe find a better title than 'Sort nodes by position before null', because no one will actually figure out what it does only by that name.
Also, about the patch:
1) you are assuming that a nodequeue is limited to 99999 nodes, which I don't think it's the case, so it wouldn't hurt to increase that number a bit.
2)
You have already done this operation above and you have the result in the $order variable.
Comment #5
eugene.ilyin CreditAttribution: eugene.ilyin commentedComment #6
eugene.ilyin CreditAttribution: eugene.ilyin commentedHello
I updated the patch. I tried to add a good title and description for the handler, but my English is not very good. If something is wrong, please correct me.
I would appreciate if you add me as the author of commit. Thanks.
Comment #8
eugene.ilyin CreditAttribution: eugene.ilyin commented#6: nodequeue-handler-sort-nodes-by-position-before-null-1881956-5.patch queued for re-testing.
Comment #9
amateescu CreditAttribution: amateescu commentedAllright, looks much better now. I improved the wording a bit and committed the patch to 7.x-2.x and 7.x-3.x. Thanks!
http://drupalcode.org/project/nodequeue.git/commitdiff/c07e9681452569a01...
http://drupalcode.org/project/nodequeue.git/commitdiff/6dc82fa1ee00cc74f...
Comment #10
eugene.ilyin CreditAttribution: eugene.ilyin commentedThanks for your module!
Comment #12
marcvangendJust what I needed. Thanks Eugene and Andrei!
Comment #13
murraybiscuit CreditAttribution: murraybiscuit commentedThanks for this, was looking to sort a list of books by featured items (nodequeue) and then by date.