Creating a snippet

You can create a snippet, which is a template that contains only the elements you want to reuse in other templates. You might create a header snippet or a footer snippet, for example. This task outlines creating a header snippet. After you create a snippet, save it to the Central Management component to make it accessible to other users and to add it to the Palette view.

About this task

There are snippets provided for you with the Rational® Publishing Engine installation in the Central Management component and in the %RPE_HOME%\utils\snippets directory.

You can create a snippet for any sections of a document. This task provides an example header for you to use as one type of snippet.

Other snippets you might create:

Procedure

To create an example header:

  1. From the Outline view, drag the master page into an element in the template editor.
  2. In the Master Page tab of the editor, add the Paragraph icon Paragraph element to the Header.
  3. In the paragraph, insert two Text icon Text elements.
  4. Double-click the first text element and enter Document Title: . Include a space after the text.
  5. Double-click the second text element and enter Section Title.
  6. Select the paragraph element to add formatting in the Properties view:
    1. Select the Border tab.
    2. Select the bottom border icon to apply formatting to a border that displays under the element.
    3. For the Margin, enter 10. This selection places the border line 10 pixels away from the text.
    4. For the Style, select single. This selection creates a single line below the paragraph element.
    5. For the Width, enter 1. This selection makes the border 1 pixel wide.
  7. Select the first text element to add formatting in the Properties view:
    1. Select the Font tab.
    2. Click the bold icon. The Set bold value window opens.
    3. Select true and click OK.
  8. Save the changes.

Example

Template example:

Template example

Output example:

Output example

What to do next

Save the template in the Central Management component with the Snippets category type. Snippets that are stored in the Central Management component are added to the Palette view.

Feedback