4 Conversion Templates

This section covers the following topics:

See also:

4.1 About Templates

Much of the power, flexibility, and complexity of Dynamic Converter is bound up in its use of templates to drive the conversion process. Templates give you immense control over the visual and navigational properties of the converted web page.

A template is a plain-text HTML or XML file that may include special tags which allow template writers to insert, repeat through, condition on, and link to various elements in the source document. You can associate these sets of formatting instructions with one or multiple content items that are stored in the Content Server. When you assign a template to your content items (on the Template Selection Rules page (see "Template Selection Rules Page"), you are controlling the way your content items will appear as web pages.

When users click the (HTML) link (generated by Dynamic Converter) for a content item, a dynamic conversion takes place using the template associated with that content item (see "Dynamic Converter Process").

4.2 Template Types

There are four types of templates available in Dynamic Converter:

  • Classic HTML Conversion templates: Classic HTML Conversion templates (formerly known as GUI templates) are written in XML (Extensible Markup Language) and are designed for use with the Dynamic Converter Classic HTML Conversion Editor. You can use the Classic HTML Conversion Editor to make changes in these templates and view them in real time. Classic HTML Conversion templates have the .ttp file extension. See Chapter 5, "HTML Conversion Templates" for more information.

  • HTML Conversion templates: The HTML Conversion Editor's primary goal is producing faithful representations of source files using the HTML, GIF, JPEG, and PNG formats. Using a C API and a powerful, customizable XML file, you can use the HTML Conversion Editor to set various options that affect the content and structure of the output. The HTML Conversion Editor is Java-based and can run in any browser instance where a JRE is present. See Chapter 5, "HTML Conversion Templates" for more information.

  • Classic HTML Conversion Layout templates: Layout templates are designed to complement GUI templates in that they control the overall page layout for converted content items. A layout template can be used to create a common set of borders, site navigation, or a company logo on each converted web page. It can also be used to maintain the Content Server look and feel with links to Home, Search, etc. Layout templates typically contain HTML code (especially HTML tables), tokens (which represent GUI template settings), and Idoc Script or a different scripting language. See Chapter 6, "Classic HTML Conversion Layout Templates" for more information.

  • Script templates: Script templates are text-based conversion templates that apply a set of scripted rules to your converted documents. They are plain-text files that must be hand-coded with elements, indexes, macros, pragmas, and Idoc Script. Changing script templates requires a knowledge of the language that they were written in. Script templates have the .hcst file extension. See Chapter 7, "Script Templates" for more information.

For more information on the differences between HTML Conversion templates and script templates, as well as suggestions for migrating, see "Migrating From Script Templates to Classic HTML Conversion Templates".

4.3 Template Strategy

Through the use of templates, Dynamic Converter users have infinite flexibility in the way they can present converted documents. Users typically use one of the following three strategies to select a template:

  1. Dynamic Converter is shipped with a number of sample templates, which are designed to meet different needs for Dynamic Converter users (polished navigation, simple HTML for document indexing engines, etc.). You can find the sample templates in the /ucm/Distribution/DynamicConverterSamples directory.

  2. With a bit more effort, you can modify one of the sample templates shipped with Dynamic Converter. Simple changes, such as adding graphics or static text, should be easily accomplished by someone with a willingness to experiment with these templates.

  3. Advanced users may choose to write a template of their own design, customized specifically to their needs. Such templates can incorporate elements from a wide range of Web standards, such as Java. Needless to say, users who go this route should have strong technical skills at the outset.

4.4 Checking In a Template

You need to check a template into the Content Server before it can be assigned to a template selection rule (see Chapter 3, "Template Rules") and used by Dynamic Converter in the conversion process.

To check in a template, complete the following steps:

  1. Open the Dynamic Converter Admin page (see "Dynamic Converter Admin Page").

  2. Click Check In Existing Template.

    The Template Check-In Form is displayed (see "Template Check-In Form").

  3. Specify all required metadata for the template.

    Make sure that you select the correct template type. If you do not, a template may not be included in the list of available templates of a particular type. If that is the case, you need to open the content information page of the checked-in template and update its template type.

  4. When you are done, click Check In to check the template file into the Content Server.

See the Content Server User Guide for more information about checking content into the Content Server.