Page 1 of 1

[SOLVED] Directly load gallery's images in slideshow

Posted: Thu Jun 05, 2014 9:08 am
by nervino
Is there a way to directly display images in the slideshow (like Lightbox, prettyPhoto etc.) when clicking on gallery's cover image?
In other words, I would load in the slideshow all the images of the gallery, without having to reload the page with all the thumbnails.

I've tried to strip the "thumb_" prefix but the slideshow doesn't display all gallery's images but the cover:

Code: Select all

<a href="{$image->thumb|escape:'url'|replace:'%2F':'/'|replace:'thumb_':''}" rel="prettyPhoto[{$galleryid}]" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a>
thanks

Re: Directly load gallery's images in slideshow

Posted: Thu Jun 05, 2014 10:28 am
by velden
I do think it is possible, but depends on your needs and setup.

You want to display the 'cover' of multiple Galleries on one single page and if clicked, that gallery's images should load in some slideshow?

Like for example: https://tinyurl.com/n6hr4lz ?

Re: Directly load gallery's images in slideshow

Posted: Thu Jun 05, 2014 11:02 am
by nervino
Thank you Velden, that's exactly what I want.
I need to achieve the same result of your example.

Re: Directly load gallery's images in slideshow

Posted: Thu Jun 05, 2014 11:54 am
by velden
Ok, let me post my templates so you can have a look if it works for you:

Gallery template 'gallerytree' (= DEFAULT!)

Code: Select all

{foreach from=$images item=image name=img}
<div class="{if $smarty.foreach.img.index > 0}hide{else}item{foreach from=$fields item=f key=fieldalias}{if $f.value} {$fieldalias}{/if}{/foreach}{/if}"><a class="fancybox" rel="gallery{$galleryid}" href="{root_url}/{$image->file}" title=""><div style="display:none" class="galtitle"><b>{$image->title}</b><br />{$gallerycomment}</div>
{if $smarty.foreach.img.index == 0}<img src="{root_url}/{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="" />{/if}</a>{if $smarty.foreach.img.index == 0}<p>{$gallerytitle}</p>{/if}</div>
{*assign var='g_prevdepth' value=$image->depth*}
{/foreach}
Gallery template 'gallerytree2'

Code: Select all

{assign var="org_gallerydir" value=$gallerydir}
{foreach from=$images item=image name=img}
{Gallery dir="$org_gallerydir/`$image->filename`"}
{/foreach}
Gallery call from template or content:

Code: Select all

{Gallery template="gallerytree2"}
Note that 'Gallery' should only contain sub-galleries (one level) and that 'Gallery' itself should NOT contain images. Template above does NOT check that.

Rest is javascript / css stuff.

Re: Directly load gallery's images in slideshow

Posted: Thu Jun 05, 2014 3:56 pm
by nervino
Thank you very much, it works!

Cheers