Customize titles in HTML output

Know about the HTML output in Adobe FrameMaker.

The title of an HTML document appears in the window’s title bar. When you add a bookmark to that page, it also appears in the bookmark list. Initially, the <$defaulttitle> building block is used for the title, which uses the first heading in an HTML file as the title for that file. Usually, the default titles are satisfactory. However, you can specify a different title by editing macro tables on the HTML reference page.

System macros and general macros can define two sets of replacement text: one that appears in the body of the code and one that is inserted in the head area.

You can modify the default title, or you can remove the default title and set up your own titles. You can also automatically pick and use map titles on the HTML pages

Modify the default titles

  1. Choose View > Reference Pages and display the HTML reference page.

  2. In the HTML System Macros table, locate the four system macros that set up the default titles. Initially, they use the <$defaulttitle> building block to assign the first heading in the file as the title. You can change any or all of them.

    Macro Name

    Replace With

    Head

    Comments

    StartOfDoc

     

    <title><$defaulttitle></title>

     
  3. Change the default macro for Head. For example, the following macro changes the text of the title to static text.

    Macro Name

    Replace With

    Head

    Comments

    StartOfDoc

     

    <title>My Book</title>

     

Set up your own titles

To set up your own titles, do the following:

  1. Choose View > Reference Pages and display the HTML reference page.

  2. Remove the four default title replacement texts from the HTML System Macros table.

  3. In the HTML General Macros table, define a macro that uses the <TITLE> HTML element in the third column, the Replace With (in HEAD) column. For example, the following macro uses a paragraph autonumber and text for the title, and also as paragraph text in the document.

    Macro Name

    Replace With

    Head

    Comments

    MyTitle

    <p><$paranum><$paratext></p>

    <title><$paranum><$paratext>

    </title>

     
  4. Map the macro to the format that you are splitting the HTML document on.

Auto-pick map title as title in STS settings file

FrameMaker provides the feature to automatically pick and use map titles on the HTML pages. Using this feature, you can publish multiple DITA maps using a single .sts file, and all the maps will have their default titles on HTML5 pages.

To customize the output settings and auto-pick up the map title as the title on HTML pages:

  1. Choose File > Publish to open the Publish dialog. Click Settings.
  2. In the Settings drop-down button, select Edit.
  3. Mention <$title> in the Title field.
  4. Click Save and Close.

When you publish the HTML 5 page, it will pick the default map title mentioned in the File> File Info dialog.

Note: You can also add a text string along with the <$title>. For example, if you add 'Title of the page:' <$title> in the .sts file and the File Info contains the title 'Tips to make your content engaging', the HTML page displays the title as 'Title of the page: Tips to make your content engaging'.