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

Files: 
CommentFileSizeAuthor
#6 nodequeue-handler-sort-nodes-by-position-before-null-1881956-5.patch2.51 KBeugene.ilyin
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#5 nodequeue-handler-sort-nodes-by-position-before-null-1881956-5.patch0 byteseugene.ilyin
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]
#1 nodequeue-handler-sort-nodes-by-position-before-null-1881956.patch2.27 KBeugene.ilyin
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Comments

StatusFileSize
new2.27 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Patch

Status:Active» Needs review

If this patch is usefull for you, please add me as author of commit of this patch. It's very important for me, thanks!

Status:Needs review» Needs work

This 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)

+++ b/includes/views/nodequeue_handler_sort_by_position_before_null.inc
@@ -0,0 +1,27 @@
'direction' => strtoupper($this->options['order'])

You have already done this operation above and you have the result in the $order variable.

Status:Needs work» Needs review
StatusFileSize
new0 bytes
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

StatusFileSize
new2.51 KB
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Hello

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.

Status:Needs review» Needs work

Status:Needs work» Needs review

Title:Sort nodes by nodequeue position before nullAdd a Views sort handler which allows combining the nodequeue position with another (random) parameter
Version:7.x-2.x-dev» 7.x-3.x-dev
Status:Needs review» Fixed

Allright, 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...

Thanks for your module!

Status:Fixed» Closed (fixed)

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

Just what I needed. Thanks Eugene and Andrei!

Issue summary:View changes

Thanks for this, was looking to sort a list of books by featured items (nodequeue) and then by date.