Page 2 of 2
Re: A quick trick to display a random image
Posted: Wed Jan 16, 2008 4:22 pm
by cnymike
What version of smarty is being used in CMSMS? I wanted to download the correct doc file from smarty.net but did not see a version of docs for 2.60 which seems to be the version in current use with CMSMS.
So which version from here...
http://www.smarty.net/download-docs.php would be the most appropriate version of the documentation to get?
Re: A quick trick to display a random image
Posted: Wed Jan 16, 2008 4:41 pm
by alby
cnymike wrote:
What version of smarty is being used in CMSMS? I wanted to download the correct doc file from smarty.net but did not see a version of docs for 2.60 which seems to be the version in current use with CMSMS.
So which version from here...
http://www.smarty.net/download-docs.php would be the most appropriate version of the documentation to get?
In CMSMS there is 2.6.18 version
2.6.14 documentation it's ok, nothing has changed in functions
Alby
Re: A quick trick to display Several random images
Posted: Sun Jan 27, 2008 1:16 am
by Andrew Prior
I used this piece of code on a site which had three little images in a left hand column under the menu. I thought
"Why not use some random images." So I put the code in three times, which works except sometimes you would get the same images showing. So I changed the code like this: (still with 10 images)
{capture assign='num'}{1|rand:
8}{/capture}
and I put this before the code for the images.
Then for the images I have the following:
Now no more duplicates. Nothing very smart from a programmer's perspective, but I was pleased.
Andrew
Re: A quick trick to display a random image
Posted: Tue Jan 29, 2008 2:08 pm
by Pierre M.
Thank you for the tip, Andrew.
Feel free to write it in the wiki with your forum account.
Have fun with CMSms !
Pierre M.
Re: A quick trick to display a random image
Posted: Tue Apr 26, 2011 4:27 am
by elkman
This is an old post but this technique works great. I have been using this to offer a different background image each time a page is loaded.
Can anyone suggest a go way to preload the background images used? These are fairly large and my understanding is the browser will look for the preloaded image only if it has an identical path.
I've tried several different CSS methods without success that I attribute to using the [[root_url]] coding in the style sheet which doesn't match the image path in the template.
Thanks for looking,
Elkman