The Plaintext template actually does a lot more than just plain text. It also converts recorded narration sounds into a form that will play in the browser. It was originally created as an experiment in making web-based PowerPoint presentations accessible to users with limited or no vision. One of our testers suggested that we not use sounds that play automatically, especially if the sound doesn't replicate what's on screen). This template plays the sounds automatically in MS Explorer but leaves it up to the user to click a link to play the sounds in Netscape and Opera.
Now the blow by blow ...
First, the usual HEAD stuff:
<html>
<head>
<TITLE>:Prefs.PageTitle:</TITLE>
</head>
Now some JavaScript to detect the browser and deal with the sounds accordingly:
<SCRIPT LANGUAGE="JavaScript">
var MSIE=navigator.userAgent.indexOf("MSIE");
var NETS=navigator.userAgent.indexOf("Netscape");
var OPER=navigator.userAgent.indexOf("Opera");
if((MSIE>-1) || (OPER>-1)) {
document.write("<BGSOUND SRC=:Slide.TransitionSound: LOOP=0>");
} else {
document.write("<EMBED SRC=:Slide.TransitionSound: AUTOSTART=TRUE>");
document.write("HIDDEN=true VOLUME=100 LOOP=FALSE>");
}
// End -->
</SCRIPT>
Rather than break up the script above, we'll explain a few PPT2HTML-specific bits here:
Slide.Transition.Sound: gives us the name of the WAV file we've added as a slide transition sound on each of the slides. The Javascript decides whether to include it as code that Explorer will understand (and play back as a background sound automatically) or as code for other browser, so it appears as a clickable link to play the sound.
Now we turn to the text. Notice that there's no :Slide.Image: here. This template produces pages that are made up entirely of plain HTML text, no images.
First, we want to grab the slide title. :Slide.Ph.TitleText: gives us that - the text from the slide's Title placeholder if any or blank if there isn't any Title placeholder there.
<CENTER><H1>:Slide.Ph.TitleText:</H1></CENTER>
<HR>
Now the slide's subtitle text if any -- we use :Slide.Ph.SubtitleText: for this. We also ask for the slide's placeholder BODY text as an html formatted bulleted list. This is a handy bit of subterfuge: A slide might have a subtitle (if it's based on the Title master) or it might have regular body text (if it's based on the normal Slide master). It'll never have both, so we're safe asking for both. We'll get a blank for one and text for the other. We get what we're after in one neat little smattering of HTML:
<CENTER><H2>:Slide.Ph.SubtitleText:</H2></CENTER>
<FONT SIZE="4">:Slide.Ph.BodyText1_AsBullets.HTML:</FONT>
<HR>
The next bit produces an invisible table that contains links to our home page, the previous slide, the next slide and numbered links to each slide in the presentation. With a twist. :Nav.PreviousOrHome: links to the previous slide UNLESS we're viewing the first slide in the presentation. If we're on the first slide, it links back to the Home Page URL we specified in Preferences. :Nav.LinksToAll: produces the numbered links to each slide.
<CENTER>
<TABLE><TR>
<TD><CENTER><A HREF="Prefs.Home">Home</A></CENTER></TD>
<TD> </TD>
<TD><CENTER><A HREF=":Nav.PreviousOrHome:">Previous</A></CENTER></TD>
Finally, a horizontal rule then a little bragging -- we'll include the name of the PowerPoint file we're converting, the date we converted it on and the name of the template we used for the conversion.
<HR>
<FONT SIZE="1">
:File.NameExt: was converted to HTML on :System.Date: by RnR PPT2HTML using the :Prefs.TemplateName: template
</FONT>
Close the body tag and that's that.
</body>
</html>
Supercharge your PPT Productivity with PPTools
Content authoring & site maintenance by |