I was tasked with adding an image for each node (that has an image) to the node ordering form. Here's a patch which does that, along with images at the bottom of this post showing the changes.

The first image found in a node's image field will be used. If the node has multiple image fields, it searches them until it finds an image. The image fields are searched top to bottom, using the order from the content type's field UI:
admin -> structure -> content types -> [content type] -> fields

Two settings have been added to the Nodequeue settings form in a Nodequeue Image Settings fieldset:
Display node image: Whether or not to display node images on the node ordering form.
Image style for node image: Which image style preset to use for displaying node images on the node ordering form.

If no image is found for a node, and the setting for nodequeue images is turned on, then the image field will be blank for that node row.

node_ordering_with_image.png

nodequeue_settings_with_node_image.png

Comments

sethfisher’s picture

StatusFileSize
new9.73 KB

And here's the patch which of course I forgot to include.

Status: Needs review » Needs work

The last submitted patch, nodequeue-node_image.patch, failed testing.

sethfisher’s picture

Status: Needs work » Needs review
StatusFileSize
new9.74 KB

Sorry, first time using Tower to roll and submit a patch. Let's try this again.

sethfisher’s picture

StatusFileSize
new1.49 KB
new10.17 KB

Removing the nodequeue_image variable from variable table in hook_uninstall.

hdragon90’s picture

how i can use file *.patch?

sethfisher’s picture

@hdragon90: http://drupal.org/patch/apply. Use the .patch file in comment #4

thinkinkless’s picture

This looks like a great enhancement to the nodequeue UI.
+1 and subscribing

sethfisher’s picture

An update from the development end...I will be patching this to handle file fields as well as image fields. When that happens depends on the priorities at my job, it's a story in our backlog.

designedbyjoe’s picture

Any chance someone could patch this for me.. I'm new to patching, tried Cygwin but won't recognise command... Will try again tomorrow unless someone can help us out.

joshuautley’s picture

Is #4 good to go? This is great for jombotron carousels where the client wants to order the creatives visually instead of by title.

matkeane’s picture

Issue summary: View changes

Just to say that I just tested this against Nodequeue 7.x-2.0-beta1+19-dev and it's working fine for me. As others have said, this is a really useful addition to the UI for content editors. Not sure if my "it works for me" comment is enough to set this as RTBC?

garvin’s picture

Can anybody tell me what I'm doing wrong? I can't get patch in comment #4 to work.

Here are some specifics:

Nodequeue 7.x-2.0-beta1+19-dev

nodequeue-node_image-3.patch

-----------------------------------------------------------------------

[~/public_html/drupal/sites/all/modules/nodequeue/includes]# patch -b nodequeue.admin.inc nodequeue-node_image-3.patch

patching file nodequeue.admin.inc
patching file nodequeue.admin.inc
Hunk #1 FAILED at 241.
1 out of 1 hunk FAILED -- saving rejects to file nodequeue.admin.inc.rej
patching file nodequeue.admin.inc
Hunk #1 FAILED at 2133.
Hunk #2 FAILED at 2162.
2 out of 2 hunks FAILED -- saving rejects to file nodequeue.admin.inc.rej

Thanks!

matkeane’s picture

@garvin: The patch actually changes 2 files - the nodequeue.admin.inc you saw, but also the nodequeue.module file as well, so you need to apply the patch in the module directory itself, not in the 'includes' subfolder.

To recap, copy the patch file info sites/all/modules/nodequeue/ then run the patch command and it should apply OK. Hope that helps...

jenlampton’s picture

StatusFileSize
new7.18 KB

Rerolled for latest 2.x-dev, also added an additional setting for field, since the first-field of any node is not likely to be what people really want. Let's give this version a whirl.

kevinfunk’s picture

StatusFileSize
new7.07 KB

Reroll of #14 for the latest 2.x-dev.

jenlampton’s picture

I don't think I should review my own patch, so if anyone else is using this patch please leave a comment here with a brief review. Thank you!