User-customizable HTML placeholders (CUSTOMPH)
Occasionally you may need a way of inserting your own information into the HTML that PPT2HTML generates.
If the information applies to an entire presentation, you can add it to the presentation's document properties or even create a custom document property. PPT2HTML can pick up and insert any of these property values into your HTML.
But what if the information applies only to one slide or a group of slides, and/or changes from slide to slide?
As of July, 2010 we've added a new feature that'll let you do this. Here's how it works:
In your PPT2HTML HTML template, you can now use these new placeholders:
:CUSTOMPH1: :CUSTOMPH2: :CUSTOMPH3: ... etc.
Note: These MUST be capitalized as shown. They won't work otherwise. And like all PPT2HTML placeholders, they must be bounded by colon characters, left and right.
By default, PPT2HTML automatically processes three of these, :CUSTOMPH1: through :CUSTOMPH3: but you can create and use as many as you need:
Add this line to the [PPT2HTML] section of your PPTools.INI file:
Use any number you need in place of 12, of course. Enter 0 to turn the feature off entirely.
When PPT2HTML creates HTML, it checks each slide for "tags" containing values to substitute for these placeholders. See below for more information about tags.
The tags it looks for are:
CUSTOMPH1 CUSTOMPH2 CUSTOMPH3 etc.
Note: The tag names do NOT need colon characters (and in fact won't work if you add them).
If the current slide has e.g. a CUSTOMPH1 tag, PPT2HTML replaces the :CUSTOMPH1: placeholder in your template with the value associated with CUSTOMPH1 for that slide. Each slide can have a CUSTOMPH1 tag with different values if you like. If there's no tag, PPT2HTML replaces the placeholder with nothing ... it simply disappears in the final HTML.
- Custom placeholders in your HTML template MUST have colons at beginning and end (eg. :CUSTOMPH1:).
- The matching tags on your slides must NOT have surrounding colons.
- Both placeholders and tags must be capitalized.
- If a custom placeholder doesn't have a matching tag on a given slide, PPT2HTML replaces the placeholder with a blank.
- Use as many custom placeholders as you need, but remember that PPT2HTML will look for each custom placeholder up to the number you specify in PPTools.INI, but checking for large numbers of custom placeholders will take time. Don't use more than you really need.
- Conversely, if you include e.g. :CUSTOMPH42: in your HTML template but don't specify at least that high a number in PPTools.INI, PPT2HTML won't look for it and won't replace it with anything. You'll end up with :CUSTOMPH42: in your HTML output.
Since the text in your tags goes directly into PPT2HTML's HTML output, you can use this feature to inject special per-slide HTML, CSS, scripting or pretty much anything else you want into your HTML.
Note that while the CUSTOMPH feature operates on a per-slide level, you can also use presentation-level data using your presentation's Built In or Custom Document Properties. PPT2HTML can also pick up these and insert them into your HTML. For a list of the ones you can use and the placeholders that use them, go into the Preferences dialog box and click Codes; scroll to the bottom of the codes list.
What are TAGS?
Tags are invisible bits of information that PowerPoint can attach to presentations, slides or individual shapes on slides. Each tag consists of a name and a value. For example, this PPT2HTML feature uses tags whose names are CUSTOMPH1, etc. and whose values are the text you want to include in your HTML.
To use the feature, you'd add a tag named CUSTOMPH1 and provide whatever value you like. PPT2HTML will replace the :CUSTOMPH1: placeholder in your HTML template with the CUSTOMPH1 value when it creates HTML.
PowerPoint provides no way to work with tags but you can use add-ins or macro code to add and edit tags.
Our StarterSet Plus (a $20 upgrade to the free StarterSet add-in) includes a property inspector tool you can use to work with tags.
If you're handy with VBA and want to write your own macros for this, you'll find some useful hints and example code if you search The PowerPoint FAQ for the term "tag".[Previous] [Home] [Next]