Page 1 of 1

Simplex Image slider [CMSMS 1.11.4 “Fernandina”]

Posted: Tue Jan 21, 2014 6:28 pm
by Bumble
Hello all,

On one of my sites I'm using the Simplex slider.
I'm trying to figure out what the criteria are for it to show images and in wich order they appear.
I really can't find any logic. It displays always the same image first.
Does anyone know a way to set it up to show it ascending on filename?

The code I'm using is:

Code: Select all

{strip}
                {assign var='teaser' value='uploads/images/teaser/*.jpg'|glob}
                    {foreach from=$teaser item='one'}
{if $one|strpos:'thumb_' === false}
                        <div><img src='{root_url}/{$one}' width='970' height='500' alt='' /></div>
                   {/if} {/foreach}
            </div>
I'm also trying to get it displaying images with both .jpg and .JPG extensions. Anyone?

Thanks a lot in advance!

Re: Simplex Image slider [CMSMS 1.11.4 “Fernandina”]

Posted: Wed Jan 22, 2014 1:43 am
by JohnnyB
I wonder if @array_rand OR @shuffle will help (I didn't test).

{foreach from=$teaser|@array_rand item='one'}
{foreach from=$teaser|@shuffle item='one'}

You might have to shuffle or random the $teaser using {capture} or {assign} before you loop through with a foreach. Maybe,

{assign var='randomteaser' value=$teaser|@array_rand}
{foreach from=$randomteaser item='one'}

Re: Simplex Image slider [CMSMS 1.11.4 “Fernandina”]

Posted: Wed Jan 22, 2014 8:31 am
by velden
Just did a simple test and it seems to do what you want by default:

Code: Select all

{assign var='teaser' value='uploads/images/producten/*.png'|glob}
<pre>{$teaser|print_r}</pre>
Result:

Code: Select all

Array
(
    [0] => uploads/images/producten/10.png
    [1] => uploads/images/producten/11.png
    [2] => uploads/images/producten/12.png
    [3] => uploads/images/producten/1.png
    [4] => uploads/images/producten/2.png
    [5] => uploads/images/producten/3.png
    [6] => uploads/images/producten/4.png
    [7] => uploads/images/producten/5.png
    [8] => uploads/images/producten/6.png
    [9] => uploads/images/producten/7.png
    [10] => uploads/images/producten/8.png
    [11] => uploads/images/producten/9.png
    [12] => uploads/images/producten/news2.png
)
1