Closed (fixed)
Project:
Nodequeue
Version:
5.x-2.0-rc2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2007 at 00:13 UTC
Updated:
16 Jan 2008 at 00:22 UTC
It would be great if we could expose specific views filters and sorts for each node queue. I'm encountering use-cases where I have nodes in multiple queues, but in a given view I really only care about filtering (or more likely sorting) from one specific queue. I think something along the lines of the code below can work:
$qids = nodequeue_get_all_qids(NULL); // get 'em all
foreach ($qids as $qid) {
$tables['nodequeue_nodes_'. $qid] = array(
"name" => "nodequeue_nodes",
"join" => array(
"left" => array(
"table" => "node",
"field" => "nid"
),
"right" => array(
"field" => "nid"
),
'extra' => array(
'qid' => $qid,
),
),
"sorts" => array(
"position" => array(
'name' => t("NodeQueue: Queue Position in $qid"),
'field' => 'position',
'help' => t('When sorting by queue position, be sure the view is filtered to a single queue or the sort will not work very well.'),
),
),
);
}
return $tables;
Comments
Comment #1
joshk commentedYeah, the above code is working out (I have it stuckin my own custom_module_views.inc). The one thing it really needs is to identify the queues by name rather than number in the UI. E.g. "Nodequeue: Position in Featured Blogs" rather than "Position in Queue 2"
Comment #2
merlinofchaos commentedI don't understand what you're trying to accomplish that can't be accomplished by filtering to the queue you want, and then sorting on position.
Comment #3
joshk commentedI don't want to filter to a queue. I want a view that will show data in/out of queue (or possibly in multiple queues), but favor items based on their position (if any) in one particular queue. Think of it as "sticky at the top of lists" on steroids.
Comment #4
merlinofchaos commentedCommitted something like this. I'm not 100% happy with it, but it it'll have to do.
Comment #5
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.