Clic on photo go to next

Giooo

Joined: 2009-11-29
Posts: 2
Posted: Sun, 2009-11-29 01:32

Hi there, i want to customize my Gallery2 to have a new behavior.
When i click on a picture on an album, i would like to go to the next picture not zoom (full size) on it.

The same functionality like on facebook. It's more comfortable to switch on photos with a link on all the picture and not on a little link on the top right.

What script i have to modify to obtain this behavior ?

Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2009-11-29 01:54

I would choose a theme that has this behavior since the script is already written for this.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
voodoo911

Joined: 2009-11-12
Posts: 12
Posted: Sun, 2009-11-29 16:49

Giooo, i got the same problem, but cant solve it. Iam new in G2. My idea of solving - change code in template and add code of "next" button to image button. I think it is the simplest variant. But another trouble - i cant find code of image :)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2009-11-29 17:12

http://themes.gallery2.hu
Find a theme that has this behavior. NZDI comes to mind.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
voodoo911

Joined: 2009-11-12
Posts: 12
Posted: Sun, 2009-11-29 17:16

I tested about ten themes, wich have this feature in demo, but in fact its not there and in customisation there is no such function. I ll try NZDI, but i want to customize my theme..

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2009-11-29 17:25
Quote:
but i want to customize my theme..

Look how the NZDI theme does it and add that feature to your theme.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
voodoo911

Joined: 2009-11-12
Posts: 12
Posted: Sun, 2009-11-29 19:43

Giooo, if it is good for you, you can try my variant. Eg matrix theme. In file photo.tpl look for "{g->image id="%ID%" item=$theme.item image=$image" ( line 74) and change it in such way
<a href="{g->url params=$theme.navigator.next.urlParams}">{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}</a>
On click you will go to next page (dont forget to clear template cache to see changes). If its good for you - then SLOVED :)

 
Giooo

Joined: 2009-11-29
Posts: 2
Posted: Mon, 2009-11-30 18:24

It doesn't work, i have clean cache template on the Maintenance of the Admin part but when i click on a pics, it load me the biggest view not the next middle view. :/

 
powerful_superman

Joined: 2010-02-10
Posts: 13
Posted: Wed, 2010-02-10 23:13
voodoo911 wrote:
Giooo, if it is good for you, you can try my variant. Eg matrix theme. In file photo.tpl look for "{g->image id="%ID%" item=$theme.item image=$image" ( line 74) and change it in such way
<a href="{g->url params=$theme.navigator.next.urlParams}">{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}</a>
On click you will go to next page (dont forget to clear template cache to see changes). If its good for you - then SLOVED :)

Thanks, this is very helpful, I tried, it works! (I m using matrix theme of gallery 2.3 and created a directory "local" in "templates" and copied "photo.tpl" to this new directory then modified this new "photo.tpl" and then deleted template cache.)

Btw, this is a problem:
when browse to the last image of the album, clicking image leads to the homepage of the gallery but I do not want that, I just want it to jump back to the page of that album. Then how to solve the problem?

 
brian_l

Joined: 2010-12-01
Posts: 7
Posted: Thu, 2010-12-02 03:29

if it helps anyone I wanted basically the same thing, I did this:

{if ($theme.navigator.next.urlParams != $navigator.last.urlParams)}
<a href="{g->url params=$theme.navigator.next.urlParams}">{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}</a>
{else}
<a href="{g->url params=$theme.navigator.first.urlParams}">{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}</a>
{/if}

when it gets to the last picture is starts over at the beginning, but you could probably change the second href= to anything