Description

Creates a slide dynamically from a source file or HTML and CFML code on the ColdFusion page. The cfpresentationslide is a child tag of the cfpresentation tag.

History

ColdFusion 9: Added the slides attribute. Added PowerPoint file support to the src attribute.

ColdFusion 8: Added this tag.

Category

Syntax

<cfpresentation ...> 
<cfpresentationslide 
advance = "auto|never|click" 
audio = "pathname relative to the CFM page or the web root for audio file" 
authPassword = "authentication password" 
authUser = "authentication user name" 
duration = "duration of slide in seconds" 
marginBottom = "margin in pixels" 
marginLeft = "margin in pixels" 
marginRight = "margin in pixels" 
marginTop = "margin in pixels" 
notes = "text string" 
presenter = "presenter name" 
scale = "decimal" 
src = "absolute path|URL|path relative to CFM page" 
title = "text string" 
userAgent = "HTTP user agent identifier" 
video = "pathname relative to the CFM page 
or the web root for video file" 
useExternalProgram = "true|false" /> 
</cfpresentation>

Note:

You can specify this tag's attributes in an attributeCollection attribute whose value is a structure. Specify the structure name in the attributeCollection attribute and use the tag's attribute names as structure keys.

See also

cfchartcfpresentationcfpresentercfreportCreating Slide Presentations in the Developing ColdFusion Applications

Attributes

Attribute

Req/Opt

Default

Description

advance

Optional

See Description

Overrides the cfpresentation tag autoPlay attribute for the slide:

  • auto: after the slide plays, the presentation advances to the next slide automatically. This is the default value if cfpresentation autoPlay="yes".
  • never: after the slide plays, the presentation does not advance to the next slide until the user clicks the Next button. This is the default value if cfpresentation autoPlay="no".
  • click: after the slide plays, the presentation advances to the next slide if the user clicks anywhere in the main presentation area.

audio

Optional

 

Pathname of the audio file relative to the CFM page or the web root. The audio file must be an MP3 file.
You cannot specify both audio and video for a slide.

authPassword

Optional

 

Use to pass a password to the target URL for Basic Authentication. Combined with username to form a base64 encoded string that is passed in the Authenticate header. Does not provide support for Integrated Windows, NTLM, or Kerberos authentication.

authUser

Optional

 

Use to pass a user name to the target URL for Basic Authentication. Combined with password to form a base64 encoded string that is passed in the Authenticate header. Does not provide support for Integrated Windows, NTLM, or Kerberos authentication.

duration

Optional

 

Duration in seconds that the slide is played. If you do not specify a duration, the slide plays for the duration of the audio clip associated with the slide.

marginBottom

Optional

0

Bottom margin of the slide.

marginLeft

Optional

0

Left margin of the slide.

marginRight

Optional

0

Right margin of the slide

marginTop

Optional

0

Top margin of the slide

notes

Optional

 

Notes used for the slide. Notes are displayed only if the showNotes attribute of the cfpresentationslide tag is set to yes.

presenter

Optional

 

Presenter of the slide. A slide can have only one presenter. This name must match one of the presenter names in the cfpresenter tag.

scale

Optional

1.0

Scale used for the HTML content in the slide presentation. If you do not specify the scale, ColdFusion automatically scales the content to fit in the slide.

slides

Optional

All slides

Specifies the slide numbers required to export when the src attribute points to a PowerPoint file. Use a hyphen to specify a range; use a comma to specify non-contiguous slides. For example:slides="1-10" or slides="1,10"

src

Optional

 

HTML, SWF, or PPT source files used as a slide. You can specify the following as the slide source:

  • An absolute path
  • A path relative to the CFM page
  • A URL: Specify if the source returns HTML content
    SWF files must be present on the system running ColdFusion and the path must be either an absolute path or a path relative to the CFM page.
    If you do not specify a source file, include HTML/CFML code as the body. If you specify a source file and HTML /CFML, ColdFusion ignores the source file and displays the HTML/CFML content in the slide.

title

Optional

 

Title of the slide

userAgent

Optional

ColdFusion

Text to put in the HTTP User-Agent request header field. Identifies the request client software.

useExternalProgram

Optional

true

Boolean value to switch between OpenOffice and POI libraries:

  • true: OpenOffice libraries.
  • false: POI libraries

video

Optional

 

Video file used for the presenter of the slide. If you specify video for the slide and an image for the presenter, the video is used instead of the image for the slide. You cannot specify both audio and video for a slide. The video must be an FLV or SWF file.
The video file pathname must be relative to the CFM page or the web root.

Usage

Use the cfpresentationslide tag within the cfpresentation tag to create a slide presentation from individual SWF or HTML source files. If you do not specify a source file, include the HMTL or CFML code for the body of the slide within the cfpresentationslide tag. You can assign one presenter to each slide. Use the cfpresenter tag to define presenters referenced by the cfpresentationslide tags.
The following code shows how to create a slide presentation from existing SWF files:

<!--- The following example shows how to create a slide presentation ---> 
<!--- from individual SWF files located on the ColdFusion server. --->
<!--- Because no directory is specified, the presentation runs in --->
<!--- the browser. ---> 
<cfpresentation title="myPresentation"> 
<cfpresentationslide title="1st slide" src="slide1.swf" duration="10"/> 
<cfpresentationslide title="2nd slide" src="slide2.swf" 
audio="audio1.mp3" duration="20"/> 
<cfpresentationslide title="3rd slide" src="slide3.swf" 
audio="audio2.mp3" duration="218"/> 
</cfpresentation>

Note:

The cfpresentationslide tag requires an end tag. If you specify a source file as the content for the slide instead of CFML and HTML code within start and end tags, use the end slash as a shortcut for the end tag.

You can reference source files from a URL as long as they return HTML content. The following code shows how to create a slide presentation from HTML files located on an external website:

<!--- The following example shows how to create a slide presentation ---> 
<!--- from HTML files located on an external site. ---> 
<cfpresentation title="USGS Naming Conventions" directory="myPresenation"> 
<cfpresenter name="Robert L. Payne" title="Executive Secretary"> 
<cfpresenter name="Trent Palmer" title="Executive Secretary Foreign Names"> 
</cfpresentationslide> 
<cfpresentationslide src="http://geonames.usgs.gov/index.html" 
duration="10" presenter="Robert L. Payne"/> 
<cfpresentationslide src="http://geonames.usgs.gov/domestic/index.html" 
duration="15" presenter="Robert L. Payne"/> 
<cfpresentationslide src="http://geonames.usgs.gov/foreign/index.html"
duration="15" presenter="Trent Palmer"/> 
</cfpresentation>

Note:

The links within slides created from HTML files are not active.

Also, you can enter HTML and CFML code as the body for a slide. Within the code, you can include charts, graphs, and images, as the following code shows:

<!--- This example shows how to create a slide presentation dynamically ---> 
<!--- from HTML code and CFML code. Because no directory is specified, ---> 
<!--- the presenation runs in the client browser. ---> 
<cfpresentation title="Sales Presentation"> 
<cfpresenter name="Shyam" title="Vice President" email="shyam@somecompany.com"> 
<cfpresenter name="Ram" title="Sr. Vice President" email="ram@somecompany.com"> 
<cfpresentationslide title="Introduction" presenter="Shyam" audio="myAudio3.mp3" 
duration="10"> 
<h3>Introduction</h3> 
<table> 
<tr> 
<td> 
<ul> 
<li>Overview</li> 
<li>Q1 Sales Figures</li> 
<li>Projected Sales</li> 
<li>Competition</li> 
<li>Advantages</li> 
<li>Long Term Growth</li> 
</ul> 
</td> 
<td><img src="../cfdocs/images/artgallery/paul01.jpg"/></td> 
</tr> 
</table> 
</cfpresentationslide> 
<cfpresentationslide Title="Q1 Sales Figures" duration="14" presenter="Ram" 
audio="myAudio1.mp3"> 
<h3>Q1 Sales Figures</h3> 
<cfchart format="png" showborder="yes" chartheight="250" chartwidth="300" 
pieslicestyle="sliced"> 
<cfchartseries type="pie"> 
<cfchartdata item="Europe" value="9"> 
<cfchartdata item="Asia" value="20"> 
<cfchartdata item="North America" value="50"> 
<cfchartdata item="South America" value="21"> 
</cfchartseries> 
</cfchart> 
</cfpresentationslide> 
</cfpresentation>

Example

<!--- The following example shows how to create a slide presentation ---> 
<!--- dynamically from HTML in ColdFusion and from HTML files located ---> 
<!--- on an external site. ColdFusion writes the presentation files ---> 
<!--- to a directory relative to the CFM page. ---> 
<cfpresentation title="USGS Naming Conventions" directory="namingConventions"> 
<cfpresenter name="Robert L. Payne" title="Executive Secretary"> 
<cfpresenter name="Trent Palmer" title="Executive Secretary Foreign Names"> 
<cfpresentationslide presenter="Robert L. Payne"> 
<h3>USGS Naming Conventions</h3> 
<ul> 
<li>Overview</li> 
<li>General Naming Conventions</li> 
<li>Domestic Naming Conventions</li> 
<li>Foreign Naming Conventions</li> 
</ul> 
<p></p> 
</cfpresentationslide> 
duration="10" presenter="Robert L. Payne"/> 
<cfpresentationslide src="http://geonames.usgs.gov/domestic/index.html" 
duration="15" presenter="Robert L. Payne"/> 
<cfpresentationslide src="http://geonames.usgs.gov/foreign/index.html"
duration="15" presenter="Trent Palmer"/> 
</cfpresentation>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy