Oracle® Fusion Middleware Administrator's Guide for Dynamic Converter 11g Release 1 (11.1.1) E10634-02 |
|
![]() Previous |
![]() Next |
Home > Administrator's Guid... > Classic HTML Conversion Lay...
This section covers the following topics:
Layout templates can be used to complement Classic HTML Conversion templates (see Chapter 5, "HTML Conversion Templates"). They can be used to control the placement of items on a web page, in particular, the areas outside of the converted document. You can add shared borders, navigation, custom scripting, and much more in your layout template. You might use the layout template to create a common set of hyperlinks around your converted documents (such as "additional resources"), or you might prefer to maintain the Content Server look and feel around your documents using Idoc Script header and footer tags.
If you do not specify a layout template on the Template Selection Rules page (see "Template Selection Rules Page"), your converted document will take up the entire web browser screen area when a user clicks the (HTML) link in the Content Server interface (see "Viewing a Converted File").
If you specify a layout template, such as the default_layout.txt sample, you can add a consistent look and feel around your content items.
A typical layout template contains the following parts:
HTML top and head information
HTML tables (used to control page layout)
Tokens for your template settings (see "Tokens in Layout Templates")
Idoc Script code (for various purposes)
When used together, you will find that you can fine tune the appearance of your converted documents on a global level, giving your online information a professional and consistent look and feel.
Tokens are placeholders or variables for the Classic HTML Conversion template settings that you create in the Template Editor. A layout template is used to control the placement of items around your converted content. If you wanted to include a particular TOP or HEAD setting from your Classic HTML Conversion template (keep in mind that layout templates are frequently used with Classic HTML Conversion templates), this would normally require you to copy and paste the information into your layout template (in the TOP or HEAD HTML tag). With a token, you can reserve that space for a Classic HTML Conversion template setting.
There are four tokens available:
<!--TRANSIT - CUSTOMLAYOUT(TOP)-->
Place this token at the top of the layout template before the <HTML> tag. Your template could replace this value with an HTML declaration, such as the W3C document type identifier.
<!--TRANSIT - CUSTOMLAYOUT(HEAD)-->
Place this token between the <HEAD> tags. Your template could replace this value with a web page title, meta tag keyword, and much more.
Place this token in the <BODY> tag. Your template could replace this value with a background color, text color, link behavior, and much more.
<!-- TRANSIT - CUSTOMLAYOUT(BODY) -->
Place this token at the location where you would like your actual content items to appear on the web page. You will likely place this somewhere in the middle of your layout template. Your template will replace this value with each content item. This token can be used by itself to generate minimum HTML output so that the content item can be included in another web page. See Chapter 8, "HTML Snippets".
Dynamic Converter comes with a number of sample layout templates that you can check into Content Server and begin using right away.
The following sample layout templates are available:
The default_layout.txt template wraps Content Server borders and navigation around your converted documents using Idoc Script and HTML tables.
The default_layout.txt layout template contains the following code:
<html> <head> <!-- TRANSIT - CUSTOMLAYOUT(HEAD) --> <$defaultPageTitle="Converted Content"$> <$include std_html_head_declarations$> </head> <$include body_def$> <$include std_page_begin$> <$include std_header$> <table border="0" cellpadding="0" cellspacing="0" width="550"> <tr><td> <!-- TRANSIT - CUSTOMLAYOUT(BODY) --> </td></tr> </table> <$include std_page_end$> </body> </html>
The snippet_layout.txt template places the converted document on a web page, by itself, without the top, head, or body HTML markup. The result is very similar to what happens when there is no layout template associated, but the advantage here is that you can easily pull this content into another web page, possibly a portal site, as an HTML snippet.
The snippet_layout.txt layout template consists of a single line of code:
<!-- TRANSIT - CUSTOMLAYOUT(BODY) -->
This is a token that displays the actual content item on the web page. Since it used by itself here, minimum HTML output is generated which can be included in another web page or HTML snippets (see Chapter 8, "HTML Snippets").
Snippet Demo
The snippet_demo.hcst sample includes the basic ingredients for a portal-style web page that draws information (HTML snippets) from other content items stored in the Content Server, while preserving the borders and navigation.
The snippet_demo.hcst sample contains the following code:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>This is my incDynConv script test page</title> <meta name="GENERATOR" content="Dynamic Converter"> <$defaultPageTitle="Converted Content"$> <$include std_html_head_declarations$> </head> <$include body_def$> <$include std_page_begin$> <$include std_header$> This is a sample page that shows how to include multiple snippets of dynamically<br> converted content on a single page using the new Idoc function incDynamicConversion. <table border="1" cellpadding="0" cellspacing="0" width="550"> <tr> <td> <$incDynamicConversion("<source_contentID_1>","latest","<template_contentID_1>","snippet_layout")$> </td> <td> <$incDynamicConversion("<source_contentID_2>","latest","<template_contentID_2>","snippet_layout")$> </td> </tr> <tr> <td colspan=2> <$incDynamicConversion("<source_contentID_3>","latest","<template_contentID_3>","snippet_layout")$> </td> </tr> </table> <$include std_page_end$> </body> </html>
To create and edit a layout template, complete the following steps:
Create a new layout template in a text editor or WYSIWYG tool. For information on the contents of a layout template, see "Layout Template Contents".
Tip: Dynamic Converter is shipped with some sample layout templates that you can use as a starting point (see "Sample Layout Templates"). |
Open the Dynamic Converter Admin page (see "Dynamic Converter Admin Page").
Click Check In Existing Template and follow the steps to check in an existing template (see "Checking In a Template"). Make sure that you choose Layout Template as the template type.
Return to the Dynamic Converter Admin page.
Associate your layout template with a template rule (see "Associating a Layout Template With a Template Rule").
You can associate a particular layout template with a template rule on the Template Selection Rules page (see "Template Selection Rules Page"). In the example below, the template sample titled "default_layout" has been selected.
To specify a layout template for a template rule, complete these steps:
Open the Dynamic Converter Admin page (see "Dynamic Converter Admin Page").
Click Template Selection Rules.
The Template Selection Rules page (see "Template Selection Rules Page").
Highlight the rule that you would like to specify a layout template for.
Enter the content ID for the layout in the Layout text box (under the "Template and layout for selected rule" heading). You can also select the layout template from the Available Layouts menu.
Click Update at the bottom of the page.
In addition to associating a layout template with a specific template rule, you can also specify a default layout that is applied to all content items that do not match your defined template criteria. You specify the default layout on the Dynamic Converter Configuration page (see "Dynamic Converter Configuration Page"). In the example below, the template sample titled "default_layout" has been selected.
To set the default layout template associated with your content items, complete the following steps:
Open the Dynamic Converter Admin page (see "Dynamic Converter Admin Page").
Click Configuration Settings.
The Dynamic Converter Configuration page is displayed (see "Dynamic Converter Configuration Page").
In the Layout text box, under the Default Layout heading, enter the content ID for a layout template. You can also choose your desired layout template from the Available Layouts menu.
Click Update at the bottom of the page to enable your default templates.
The layout template that you associate with your content items may include references to other files, such as custom scripts, images, Cascading Styles Sheets (CSS), and more. In fact, if you have a number of script templates that were created in an earlier version of Dynamic Converter, you can copy the Idoc Script tags from those templates and paste them into the new layout template. See Chapter 7, "Script Templates" for more information on script templates.
Identifying the appropriate path to use for an included file can be a challenge because the location of each content item checked into the Content Server may change if its metadata changes (metadata ultimately determines the URL of a content item). As such, you will not know the address of a new content item until it is checked into the Content Server with assigned metadata.
In this type of environment, relative paths create immediate problems. You must use a path that will work from anywhere in the Content Server. See "Relative URLs in Templates and Layout Files" for a list of solutions.
Note: To assign a default layout template to your content items, see "Setting the Default Template". In earlier versions of Dynamic Converter (prior to version 6), default layouts were assigned as configuration variables in Content Server. You can now make this setting on the Dynamic Converter Configuration page (see "Dynamic Converter Admin Page"). |