Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting pictures into a web page using ColdFusion 1

Status
Not open for further replies.

jgortney

MIS
Apr 11, 2002
2
US
I need to find a way to insert many pictures into a web site using ColdFusion. The site I am maintaining is a College Web Site and in it there is a "New Construction" page showing the progress of a new building being built on the campus. I now have 48 pics on the page but I have been having to do tedious HTML editing to insert the Pics. Is there any way to use ColdFustion so all I would have to do is modify one section of code each time I need to update the Page? Any help would be appreciated, I am very new at using ColdFusion.

Thanks,
Jeff
 
you could use CFdirectory to get a list of files that are in a directory and then loop over the results and display each image out that way.

<CFDIRECTORY ACTION=&quot;List&quot; NAME=&quot;getImages&quot; DIRECTORY=&quot;pathtodirectory&quot; FILTER=&quot;*.jpg&quot;>

<CFOUTPUT QUERY = &quot;getImages&quot;>
<CFIF Size GT 0>
#name#<BR>
</CFIF>
</CFOUTPUT>

this is the basic code to do this

then when a new image becomes available all you have to do is to put it into the directory specified in the directory attribute of the CFDIRECTORY tag !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top