Didn't want to hijack the 2.x issue for the 3.x patch, but I thought the feature would be nice.

Okay, NG 3.x uses the default imagecache formatters, just how it should be!

Here is an implementation which I think is the right way, using an imagecache formatter for image gallery nodetypes. To use this, you have to set the formatter in the "display fields" options of the image type to "node-gallery-display linked to galleries next". I had to shorten this text, because it destroys the layout otherwise. It works for all imagecache presets, just as the default formatters.

We could also create custom formatters for lightboxes, or any other stuff that would be comfortable to have in a gallery. What do you think?

Comments

igorik’s picture

it sounds good, does it mean that it will be works like in facebook - when you will click on the image, it will be switched to the next image?

thanks
Igor

justintime’s picture

Status: Needs review » Needs work

@scroogie, check your patch - I think you've got a problem there. The first hunk is removing all the 'path' elements from the theme array returned from node_gallery_theme(). Maybe that's why you're having theme confusion - your theme functions aren't being loaded :)

justintime’s picture

Status: Needs work » Needs review

scratch that, I see now that you were just removing duplicate code.

justintime’s picture

Committed #3640700 by scroogie: 3.x link image to next node

justintime’s picture

Status: Needs review » Fixed

Marking as fixed.

scroogie’s picture

Nice that it went in. Hope you like it.

Do we have a status for "needs documentation?"
I guess a lot of people won't find this.

justintime’s picture

Component: Code » Documentation
Assigned: scroogie » Unassigned
Category: feature » task
Status: Fixed » Needs work

Good point - transforming this issue into a documentation task needing work.

igorik’s picture

Hi

I am sorry but I have no idea from this conversation, what I need to do for having this feature

thanks
Igor

justintime’s picture

Heh, that's why it's a Documentation that needs work :)

Quick version, if you're using the default content types supplied by NG, visit admin/content/node-type/node-gallery-image/display and select 'node-gallery-display linked to next image' under the "Full Node" column for the "Gallery Image" row. Save your changes, and visit a gallery image node page. Click the image, and you should navigate to the next one.

igorik’s picture

Thanks for explanation, it works nice.
However, I found that this style doesn't respect "Use Named Anchors on Image "Previous" and "Next" links" so click on Next link is going right to path#node-inner, but click on the image is without #node-inner in his path.

scroogie’s picture

Oh, than that was a mistake in my patch that slipped by. I'll take a look.

scroogie’s picture

Component: Documentation » Code
Category: task » bug
Status: Needs work » Needs review
StatusFileSize
new1.6 KB

Here is a fix. But now I'm sad that this needs an extra database hit :(

igorik’s picture

Status: Needs review » Reviewed & tested by the community

It works nice, thanks for quick patch!

justintime’s picture

Status: Reviewed & tested by the community » Fixed

Committed that to dev as well. Also, we use static caching on relationships, so there *isn't* another hit to the DB here (the relationship is also loaded by the navigator IIRC).

scroogie’s picture

Ah, great work!

Status: Fixed » Closed (fixed)

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