Does anyone know of a good slideshow component or snippet for cf? basically i would just like to rotate a few thumbnail size images in a featured area of my website. thanks.

Download the gallery_viewer.zip, unzip, and put the gallery_viewer.cfm file into any folder with .jpg images. Upload the file and browse to the page to view your slideshow gallery.

http://www.webhostingelite.com/downloads/gallery_viewer/proxy_gallery_viewer.cfm?file=#UrlEncodedFormat(

<!---gallery Viewer 2.1.1 Source Code--->

<!--- param the image to show --->
<cfparam name="url.image" default="1">

<!--- directory --->
<cfset dir = expandPath(".")>

<!--- get all images --->
<cfdirectory directory="#dir#" filter="*.jpg" name="images" sort="name">

<!--- quick sanity checks --->
<cfif not isNumeric(url.image) or url.image lte 0 or url.image gt images.recordcount or round(url.image) neq url.image>
<cfset url.image = 1>
</cfif>

<html>
<head>
<title>
<!---JSD - dynamically retrieve the image name into the page title, SEO --->
<cfoutput>#images.name[url.image]#</cfoutput>
</title>
</head>
<body>

<!--- do we even have images? --->
<cfif images.recordCount>
<cfoutput>
<table align="center">
<tr><!---JSD - dynamically retrieve the image name into the page text, SEO --->
<td colspan="2"><cfoutput>#images.name[url.image]#</cfoutput></td>
</tr>
<tr>
<td><cfif url.image gt 1>
<!--- JSD - Set the Delimeter path to "\/" for windows and linux--->
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image-1#">Previous</a>
<cfelse>
Previous
</cfif></td>
<td><cfif url.image lt images.recordCount>
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image+1#">Next</a>
<cfelse>
Next
</cfif></td>
</tr>
<tr>
<td colspan="2"><img src="#images.name[url.image]#"></td>
</tr>
<!--- links --->
<tr>
<td>
<cfif url.image gt 1>
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image-1#">Previous</a>
<cfelse>
Previous
</cfif> </td>
<td align="right">
<cfif url.image lt images.recordCount>
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image+1#">Next</a>
<cfelse>
Next
</cfif> </td>
</tr>
</table>
</cfoutput>
</cfif>

</body>
</html>

thanks. i will try that. an add on question before i explore this; i am going to use this to show like 5 different movie posters, 5 different music posters, etc for about 7 subjects or so to show a featured type gallery. would i put the 5 thumbs in an indiv folder for each subject then put the .cfm file in the each folder and then reference from there?

thanks again.

This article has been dead for over six months. Start a new discussion instead.