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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eugene.ilyin’s picture

eugene.ilyin’s picture

Status: Active » Needs review
eugene.ilyin’s picture

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

amateescu’s picture

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.

eugene.ilyin’s picture

Status: Needs work » Needs review
FileSize
0 bytes
eugene.ilyin’s picture

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
eugene.ilyin’s picture

Status: Needs work » Needs review
amateescu’s picture

Title: Sort nodes by nodequeue position before null » Add 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...

eugene.ilyin’s picture

Thanks for your module!

Status: Fixed » Closed (fixed)

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

marcvangend’s picture

Just what I needed. Thanks Eugene and Andrei!

murraybiscuit’s picture

Issue summary: View changes

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