Customization: Click on an image to load the next picture

MasterPat

Joined: 2007-09-20
Posts: 1
Posted: Thu, 2007-09-20 23:53

Hey guys,

if you want to look through a new album of your friend (one-picture-view), it can be very annoying to click everytime on this small "next"-button above the picture, especially if your friend often turned his camera, so you have a change between landscape and upright format - so this "next"-button is not at the same place due to various picture-format.

I tried to write a small plugin, but I didn't find any possibility to work this out. So I tell you where you have to insert some code.

You have to edit the template-file "photo.tpl", so find it at something like this: yourGalleryFolder/themes/yourTheme/templates. Make here a new folder called "local" and copy the photo.tpl in this new folder. Now you have to edit this copied file:

Find this piece of code:

{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}

Overwrite it with this:

{if isset($theme.navigator.next)}
<a href="{g->url params=$theme.navigator.next.urlParams}" title="{g->text text="Next"}">
{/if}
{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
{if isset($theme.navigator.next)}
</a>
{/if}

Now you can click at this one-picture-view on your pics and it will load the next one (if it wasn't the last).

I hope, this can help you... and sorry for my bad english ;)

Some greets from Germany,
Patrick

 
petri
petri's picture

Joined: 2005-12-15
Posts: 207
Posted: Mon, 2008-11-03 09:45

does not work on matrix... for me anyway

 
sandervk

Joined: 2009-09-12
Posts: 1
Posted: Sat, 2009-09-19 10:56

I tried to do this on the carbon theme, but it doesn't work.
What am i doing wrong?
Sander

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16503
Posted: Tue, 2009-09-22 15:46

Works for me in Matrix, make sure you clear your cache:
http://codex.gallery2.org/Gallery2:Editing_Templates

FAQ: How can I clear cached data?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
powerful_superman

Joined: 2010-02-10
Posts: 11
Posted: Wed, 2010-02-10 23:57

The code doesn't work, but:
Find this piece of code (for matrix theme):
{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}

and replace it with:
{if isset($theme.navigator.next)}
<a href="{g->url params=$theme.navigator.next.urlParams}" title="{g->text text="Next"}">
{/if}
{g->image id="%ID%" item=$theme.item image=$image
fallback=$smarty.capture.fallback class="%CLASS%"}
{if isset($theme.navigator.next)}
</a>
{/if}

Then it works!
Good luck!