Could someone help a newbie with some simple code, please
Posted: Fri Mar 13, 2009 1:23 am
Hi. This code lets me add photos with the form lc0x.jpg to a folder to display random images
I know how to use an if else statement to choose global content blocks dependent on the random number.
However, adding a global content block like the one below for each image seems pretty inefficient!
set Link. and Image from that row in the table, and place them in the code thusly:
or indicate a better method?
I'd appreciate it.
Andrew
I would like to add some details to the images and make them link to an associated page{capture assign='num'}{1|rand:17}{/capture}
{* generate a random number between 1 and 3, assign it to 'num Equates to no. of photos in left logo folder *}
{if ( 10 gt $num ) }
{else}
{/if}
I know how to use an if else statement to choose global content blocks dependent on the random number.
However, adding a global content block like the one below for each image seems pretty inefficient!
It strikes me I should be able to make a table of four columns, being Index No. Link. Label. and Image. Then, when $num = Index,
set Link. and Image from that row in the table, and place them in the code thusly:
Can someone point me to a help file that would take me through such a process?
or indicate a better method?
I'd appreciate it.
Andrew