I am using assets for a photo gallery site.

The first page shows the list of images as thumbnails, when you click a thumbnail it loads a page where it just shows the single image (passing the file_id through segment_4).

What I want to do make the large image on this page clickable to go to the next image on it's own page (unique URL).

Can someone tell me if this is possible and if so how i should go about it.

big thanks.

  • How exactly are you trying to do this? One entry per file? Channel:entries? Files:entries?
    – Sobral
    May 15 '13 at 16:18
  • @RobsonSobral - I am using a channel field. I have tried using the following code but for some reason the offset="1" does not work. <a href="/{segment_1}/{segment_2}/{segment_3}/{photo_gallery offset="1" limit="1" file_id="{segment_4}"}{file_id}{/photo_gallery}">{photo_gallery limit="1" file_id="{segment_4}"}{exp:ce_img:single src="{url}" width="960" quality="95" crop="yes" cache="yes" filter="auto_sharpen"}{/photo_gallery}</a>
    – ljm
    May 15 '13 at 18:32
  • The offset parameter skips the first X files. I don't have Assets to test out, but does the {count} parameter work within the {photo_gallery} tag pair?
    – Siebird
    May 15 '13 at 19:32
  • yeah i get how the offset works but it just seems to fail in this case. I might have to hit support direct to see if it is a bug. thanks for taking the time to try and help.
    – ljm
    May 16 '13 at 11:38

You could use the Will Hunting plugin to do simple math to increment/decrement the next/prev links based off {segment_4}:

<a href="{exp:will_hunting:solve exp="{segment_4} - 1"}">prev page</a>
<a href="{exp:will_hunting:solve exp="{segment_4} + 1"}">next page</a>
  • the only problem with your solution is what if the file id is not always in the continues number order, ie the post could contain images from different folders and in different orders
    – ljm
    May 15 '13 at 18:28
  • That was never mentioned, but a valid point.
    – Siebird
    May 15 '13 at 19:23
  • Your answer actually ended up being the way to go but because the offset doesn't work with a single use of file_id (coming from {segment_4} in my case) I used the {count} tag referenced from segment_4 which did the job. The {count} feature is actually not mentioned in the official docs so i didn't think to try that.
    – ljm
    May 27 '13 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.