Adding slides

Use one cfpresentationslide tag for each slide in the presentation. The presentation runs the slides in the order they are listed beneath the cfpresentation tag. You can create content for a slide in one of the following ways:

Source

Description

Example

A SWF or HTML file

The file must be located on the system running ColdFusion. You can specify an absolute path or a path relative to the ColdFusion page.

<cfpresentationslide title="slide 1" src="presentation/slide1.swf"/><cfpresentationslide title="slide 2" src="c:/presentation/slide2.htm"/>

A URL

The URL must return HTML content.

<cfpresentationslide title="slide 3" src="http://www.worldview.com/index.htm"/>

HTML and CFML code on the ColdFusion page

Enclose the HTML and CFML code within the cfpresentationslide start and end tags.

<cfpresentationslide><h3>Total Sales</h3><cfchart format="jpg" chartwidth="500" show3d="yes"><cfchartseries type="pie" query="artwork" itemcolumn="issold" valuecolumn="price"/></cfchart></cfpresentationslide>

Creating content from source files

The following code creates a presentation with three slides from source files in different locations:

<cfpresentation title="Garden Mania" directory="gardenPresentation">
<cfpresentationslide title="Seeds of Change" src="c:\gardening\seeds.html" audio="media\hendrix.mp3" duration="30"/>
<cfpresentationslide title="Flower Power" src="shockwave\flowerPower.swf" duration="40"/>
<cfpresentationslide title="Dig Deep" src="http://www.smartgarden.com/index.htm" duration="15"/>
</cfpresentation>

In this example, ColdFusion generates the files required to run the presentation in the gardenPresentation directory. It generates a new SWF file in the data subdirectory from each of the slides. ColdFusion also copies the hendrix.mp3 file and saves it in the data subdirectory.

Note: Links within slides created from HTML files are not active.

Creating content from HTML and CFML code

If you do not specify a source file for a slide, create the content by using HTML or CFML in the cfpresentationslide tag body. The following presentation contains one slide with each with the following types of content:

  • Generated from HTML
  • Generated from HTML and CFML
  • Extracted from an HTML file on an external website

<cfpresentation title="The Road Ahead">
<cfpresentationslide title="Yellow Bricks" audio="myaudio1.mp3" duration="10">
<h3>Yellow Bricks</h3>
<table cellpadding=10>
<tr>
<td>
<ul>
<li>Way to go Dorothy</li>
<li>Making tracks</li>
<li>No place like home</li>
</ul>
</td>
<td><img src="../cfdocs/images/artgallery/maxwell01.jpg"/>
</td>
</tr>
</table>
</cfpresentationslide>
<cfpresentationslide title="Wild Ride" duration="5">
<h3>Wild Ride</h3>
<cfchart format="jpg" title="Who's Ahead" show3D="yes" chartHeight=500 chartWidth=500>
<cfchartseries type="pyramid">
<cfchartdata item="Dorothy" value=10>
<cfchartdata item="Tin Man" value=30>
<cfchartdata item="Scarecrow" value=15>
<cfchartdata item="Lion" value=50>
<cfchartdata item="Toto" value=5>
</cfchartseries>
</cfchart>
</cfpresentationslide>
<cfpresentationslide title="The Golden Age of Ballooning" duration="10" src="http://www.balloning.com/index.htm"/>
</cfpresentation>

Note: The value for the format attribute of the cfchart tag must be JPG or PNG.

The content for slides is not limited to static data: you can generate content from information extracted from a database or a query of queries.

Get help faster and easier

New user?