While testing the module, I thought that it could be possible to create a block that would display all the images contained in a gallery while viewing a specific image of the gallery.
If it was just possible to get the gallery ID through the node ID of the image, using arguments and relationships, we could list all the image of the same gallery, and even use ajax pager to browse very quickly to any image. This would equal Flickr's img browsing block.
But unfortunately, I could figure out which argument or relationship to use. I got very confused to see some node/gallery/gallery/ID everywhere and never got the block working.

Any idea on how to achieve this ?

Comments

jjjames’s picture

Also interested in getting a strip of images to use for navigating through the gallery ala Flickr.
Thanks

wilson98’s picture

this has been supported in current version. use the "Node Gallery Image: Galley Id" as arguments to filter the image display.

Anonymous’s picture

I tried using the argument you mentioned (you'll notice a typo 'Galley' instead of 'Gallery'), giving the argument the value 'Node ID from URL'. This only works when I'm viewing the Gallery node, it retrive the gallery ID, and lists the images contained in the gallery.. but what I want is different. When I'm viewing an image node, I want the view to list the other images contained in the same gallery.

Am I missing something ?

jjjames’s picture

Viewing the adjacent images within the same gallery is what I'm lookin for too. Gonna watch this thread.

wilson98’s picture

it's not supported yet.

Anonymous’s picture

Title: Views block displaying other images from the same gallery » More flexible Views integration: Views block displaying other images from the same gallery
Category: support » feature

From what I can imagine, the goal would be to be able to retrieve the gallery ID through the Node ID Argument.

Maybe something like :

Argument -> Node ID from URL
Relationship -> Gallery ID
Field -> Node Image (through relationship)

kmonty’s picture

I know this is a little hacky, but you can achieve the flickr-esque navigator by overriding your theme_ functions that give you the next/previous links. I did this for a project I did with Node Gallery 1.x

jjjames’s picture

Would you mind sharing exactly how you did this?
thanks

kecinzer’s picture

Subscribing.

dropchew’s picture

Maybe its good to have an function in the api that takes in a image nid and returns the gallery's nid, yeh?

Golem07’s picture

+1 - such a feature is really needed in node gallery

lierbag’s picture

Agreed. This would be a really useful feature. I've been trying to modify the module to do this, but no success yet... I'm going to try kmonty's approach. To be continued....

kmonty’s picture

Component: Miscellaneous » Views Contrib
Anonymous’s picture

Subscribe, I'm very interested on this too

jahmal’s picture

Hi.

I have managed to create view with all images related to gallery you are currently in (Whilst on Node_Gallery_Image Node page)

Here are the steps:
- Create new View (block)
- As a field add : Node Gallery Image: Image
- As an argument add : Node Gallery Image: Galley Id
- Set : Action to take if argument is not present: Provide default argument
- set it to PHP code : return node_gallery_gallery_to_arg(arg(1));

This works for me and we have nice thumbnails in the block showing images from the same gallery

Regards,
Rafal Jachimczyk

Anonymous’s picture

Thanks Rafal, I will try it.

dbeall’s picture

Version: 6.x-2.0-alpha7 » 6.x-2.0-alpha12

would be good to add to the handbook.. but no luck here.
Maybe I missed something..
using- Node Gallery 6.x-2.0-alpha12, Views 6.x-2.8

Anonymous’s picture

Will version 3 allow us to do this kind of queries?

justintime’s picture

Issue tags: +ng3

It should, and if it can, it will provide such a block out-of-the-box. I've actually made a lot of progress on 3.x as of late. Most of the big features are complete. The remaining big items before releasing an alpha are migrating settings (data migration is already done), and theming. I'll tag this issue and update it once I find the answer.

Anonymous’s picture

I'll wait impatiently for it ;)

zuzu83’s picture

Anonymous’s picture

Please, don't forget about this ;)

scroogie’s picture

The views integration kind of allows this out of the box, at least on the gallery node. See the demopage for an example: http://ng3demo.sysadminsjourney.com/galleriffic/2468

You can of course create a block display for a gallery view. What is currently not in the module is a block that retrieves the whole gallery on the page of an image node. We discussed a little bit of this in #974228: NG Navigator Block
If you can elaborate what you need, and perhaps can contribute to the design (perhaps with a mockup), it would be very welcome.

Anonymous’s picture

Hi, sorry for the delay in my reply,
I would like to display, in the picture node, other pictures from the same gallery on a (views) block. To make easier to jump from one picture to another.
Something similar to your comment #7 #974228: NG Navigator Block but displaying pictures with the same parent gallery id that the current picture.

Thank you guys, your doing a great issue-cleaning effort with Node Gallery ;)

justintime’s picture

@jmesam - this sounds pretty much like what I'm shooting for with a jcarousel add-on. Watch the issue queue/project home page for updates.

scroogie’s picture

Wouldn't this just be a

$gallery = node_load($node->nid); // or args()
$images = node_gallery_get_images($gallery); 
foreach ($images as $image) print l(theme('imagecache', 'preset'), 'linksomewhere');

in the block code?

Anonymous’s picture

I try to put scroogie's code on a block and I get these error:

  • Warning: array_fill() [function.array-fill]: Number of elements must be positive in db_placeholders() (line 276 of /var/www/includes/database.inc).
  • Warning: implode() [function.implode]: Invalid arguments passed in db_placeholders() (line 276 of /var/www/includes/database.inc).
  • User warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN node_gallery_images ngi ON ngi.nid = n.nid WHERE n.nid IN () AND n.st' at line 1 query: SELECT n.nid,n.title,n.status,n.created,n.changed,f.filepath,ngi.weight FROM node n INNER JOIN node_revisions r ON r.vid = n.vid INNER JOIN content_ cck ON cck.nid = n.nid INNER JOIN files f ON f.fid = cck. INNER JOIN node_gallery_images ngi ON ngi.nid = n.nid WHERE n.nid IN () AND n.status = 1 in _db_query() (line 141 of /var/www/includes/database.mysqli.inc).
  • Warning: Invalid argument supplied for foreach() in eval() (line 4 of /var/www/includes/common.inc(1693) : eval()'d code).
scroogie’s picture

jmesam, no! That was only pseudo-code for justin! :D

Anonymous’s picture

Oops :)

justintime’s picture

@jmesam - while not quite ready for a full release yet, I put up a demo of the jcarousel module I'm working on on the ng3demo site. You can preview it here: http://ng3demo.sysadminsjourney.com/node/2473

Is that along the lines of what you're looking for?

Anonymous’s picture

That's exactly what I'm looking for :)

Thanks

jjjames’s picture

Cool! When do you think this module will be ready for the public?
thanks

justintime’s picture

Issue tags: -ng3

@jjjames - forgot to add that the "official" issue for the new module is #987910: node_gallery_jcarousel nearing completion - your answer is over there.

dddave’s picture

Status: Active » Fixed

Enjoy the jcarousel integration in NG3.

Status: Fixed » Closed (fixed)

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