[SOLVED] Directly load gallery's images in slideshow

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm
Location: Roma, Italy

[SOLVED] Directly load gallery's images in slideshow

Post 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
Last edited by nervino on Thu Jun 05, 2014 3:56 pm, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Directly load gallery's images in slideshow

Post 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 ?
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm
Location: Roma, Italy

Re: Directly load gallery's images in slideshow

Post by nervino »

Thank you Velden, that's exactly what I want.
I need to achieve the same result of your example.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Directly load gallery's images in slideshow

Post 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.
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm
Location: Roma, Italy

Re: Directly load gallery's images in slideshow

Post by nervino »

Thank you very much, it works!

Cheers
Post Reply

Return to “Modules/Add-Ons”