Page 1 of 1

[SOLVED] random image on slideshow home page

Posted: Fri Jun 21, 2013 2:21 pm
by giapippo
hello
I'm adapting a template to cmsms
I would like to randomly load images from a directory on the homepage
the current template is:
----------------------------------------------------------------
<div class="flexslider">
<ul class="slides">
<li> <img src="uploads/images/flexslider/3.jpg" alt=""/></a> </li>
<li> <img src="uploads/images/flexslider/6.jpg" alt="" /> </li>
<li> <img src="uploads/images/flexslider/4.jpg" alt="" /></a>

</li>
</ul>
</div>
------------------------------------------------------------

what i have to do ?

thanks

gianluca

Re: random image on slideshow home page

Posted: Fri Jun 21, 2013 3:50 pm
by staartmees
use Showtime, it has all you need.

Re: random image on slideshow home page

Posted: Fri Jun 21, 2013 4:22 pm
by Rolf

Re: random image on slideshow home page

Posted: Fri Sep 06, 2013 9:05 am
by giapippo
sorry

but in the simplex template i have added only the tag {$teaser|@shuffle} and all work fine

a simple way like this? ;D ;D

thank

{assign var='teaser' value='uploads/simplex/teaser/*.jpg'|glob}
{capture}{$teaser|@shuffle}{/capture}
{foreach from=$teaser item='one'}
<div><img src='{root_url}/{$one}' width='852' height='200' alt='' /></div>

Re: random image on slideshow home page

Posted: Fri Sep 06, 2013 9:14 am
by staartmees
please add [SOLVED] ito the title

Re: random image on slideshow home page

Posted: Fri Sep 06, 2013 12:14 pm
by Jo Morg
giapippo wrote:sorry

but in the simplex template i have added only the tag {$teaser|@shuffle} and all work fine

a simple way like this? ;D ;D

thank

{assign var='teaser' value='uploads/simplex/teaser/*.jpg'|glob}
{capture}{$teaser|@shuffle}{/capture}
{foreach from=$teaser item='one'}
<div><img src='{root_url}/{$one}' width='852' height='200' alt='' /></div>
Actually I would avoid the
{capture}{$teaser|@shuffle}{/capture}
block altogether, and replace it by
{shuffle($teaser)}.

Capturing is too slow...

Re: random image on slideshow home page

Posted: Fri Sep 13, 2013 4:56 am
by luya
Thank you for the link. I really need that for responsive slideshow as Showtime simple does not cut it.