When it comes to subqueues, the only way to have multiple subqueues is to create a separate module using the smartqueue API. A standard nodequeue only has one subqueue (which is where all the nodes are really stored since a parent nodequeue only contains subqueues, not nodes, per the documentation).

I have had a couple instances lately where I need multiple subqueues under one standard nodequeue instead of multiple parent nodequeues. In these cases, the content isn't tied to something common like a taxonomy vocab or user ID; they're just arbitrary collections of nodes. Another reason for using one parent nodequeue is that a separate view is created for each one, and if I need multiple queues, I don't want to clutter the Views admin interface with unnecessary views. This is especially unnecessary since the sqid can be used as an argument in Views.

Attached is a patch that adds the functionality of creating multiple subqueues for a standard nodequeue. As it is now, it adds two checkboxes and two textfields to the nodequeue_edit_queue_form:

  • Add additional subqueues - Checked to specify that the user wants to add subqueues to the nodequeue
  • Do not create default subqueue - Keeps the default subqueue from being added and only adds the user-specified subqueues
  • Two textfields for subqueue names

One sticky point was the determination of the reference value for the subqueues. For the default subqueue in a standard nodequeue, the reference is set to the qid of the parent nodequeue. For other modules that use the Smartqueue API, the reference is another id value, such as vid (Taxonomy Smartqueue) or uid (User queues). What I decided to do what just to use the sqid for the reference, since that is the most unique value available for these subqueues.

The primary thing that needs to be done is to add the jQuery so the adding of the subuques can be dynamic. What I have in mind is initially just displaying the "Add additional subqueues" checkbox with the textfield for the first subqueue name, and an "Add another subqueue" button, so that when the Add button is clicked, it adds another subqueue name textfield. I will be working on that over the next few days.

I'm sure this could use some impovement, but the basic framework is there.

CommentFileSizeAuthor
multiple_subqueues.patch4.04 KBwonder95

Comments

socialnicheguru’s picture

Status: Active » Needs review
ezra-g’s picture

Status: Needs review » Needs work

Wonder95 and I discussed this out of the queue a bunch a while ago and since that discussion was spread across several places, I've lost track of where we left off. In any case, I did a functional review of this patch. Let's pick up the discussion in this issue.

In general I think this is a reasonable feature but we should be thoughtful in how we implement it, since it affects other use cases.

A) I realize you want the ability to add arbitrary subqueues but depending on your use case, you might be interested in having a subqueue per-nodereferenced node since it removes the need to manually manage subqueues #184319: Smartqueue for CCK node reference - a subqueue for each value.

B) Subqueue names don't re-populate after entering them and saving the form, which is somewhat confusing when I submit and the form refreshes. "Have my new subqueues been added?" A confirmation message like "The subqueue [name] has been added to [name of nodequeue]"

C) Given the lack of comments on this issue and lack of this feature in NQ's history, I wonder what percentage of Nodequeue users will use this feature and therefore whether we shouldn't at least hide the new subqueue options in a collapsed fieldset if we do add it, and maybe hide that fieldset with a permission. I'm not sure if that added complexity makes sense.

Since this is the queue edit form and the context is "things that control the whole queue", I wonder if we shouldn't move the option to add a new subqueue somewhere else entirely. Perhaps at admin/content/nodequeue in the subqueues column for queues for which the user can manually add, we can display the # of subqueues and an "add more link". Something like

Only local images are allowed.

D) If I don't check "add additional subqueues" it seems like my input in the new subqueue fields is ignored. Couldn't we eliminate this checkbox and see if the user has entered anything in these fields? Also, the text "Do not create default subqueue" next to "add additional subqueues" confused me because they seem contradictory.

E) How can I delete individual subqueues? That's "kind of important."

F) Having only 2 fields here without the ability to add additional fields to the form makes it seem like we can only add 2 subqueues. It might be an improvement to just have an "add new subqueue" field and then either refresh the page or add a new field to the form 1asynchronously as you suggested.

G) Regarding references, I'm not sure we get any value by using the sqid as the reference, since we already have that in the sqid column, and it seems like the reference of the regular subqueue and the manually added ones might collide. It might be simplest for new subqueues to also use the QID as a reference.

amateescu’s picture

Status: Needs work » Closed (won't fix)

It seems that no one is willing to continue this work/discussion and there aren't even more people requesting it, so I'm closing because it can be done in a custom module, as @wonder95 said in the OP.