An HTML page comprises three elements: content, layout, and styling. For single sourcing, it is best to separate content from layout and styling. Although CSS files separate styling from content, layout remains embedded in the HTML code. By using master pages, you can separate layout and styling from content.
A master page contains layout information and is associated with a CSS file. A master page is a template for HTML topics. You can define the placeholders for header, footer, and topic. You can include breadcrumbs, Mini TOC, snippets, variables, fields, and symbols. You can also apply condition tags to a master page.
You can create a topic using a master page or associate an existing topic with a master page. When you create a topic using a master page, the topic placeholder content is placed in the resulting topic. If you apply a master page to an existing topic, the topic placeholder content is ignored. In this case, actual content of the topic replaces the topic placeholder in the master page at the time of preview and generation.
The layout information defined in master pages is not visible in Author view. You can see the layout when you generate output or preview an associated topic. The topic content is placed in the topic placeholder, and the layout is inherited from the master page. All placeholders defined in the master page are also populated with relevant information when you generate output.
You can also import and export master pages to use across projects.
You can add a master page in two ways:
- From the Master Pages panel:
When you add a master page using the Master Pages panel or upgrade to RoboHelp 2019 from a previous version, by default, the master page files are stored in the assets/masterpages folder in the Contents panel. - From the Contents panel:
When you add a master page to a different project folder in the Contents panel, the master page files are stored in that project folder.
Irrespective of the location in which you add a master page, access and manage all master pages in your project from the Master Pages panel.
-
To add a master page through the Master Pages panel:
- In the Author toolbar, click Master Pages. The Master Pages panel opens.
Click in the upper-right corner of the panel.
The New Master Page dialog box opens.
To add a master page through the Contents panel:
- In the Author toolbar, click Contents. The Contents panel opens.
- In the Contents panel, right-click a folder, or click Options (
), and choose New > New Master Page.
The New Master Page dialog box opens.
-
In the Master Pages panel, against the master page you want to customize, choose Options (
) > Edit.
The master page opens as a tab, displaying the header, topic, and footer placeholders.
When you create a topic from a master page, the topic includes content from the master page. Copyright information is an example. When you apply a master page to a topic, actual content of the topic replaces the topic placeholder in the master page at the time of preview and generation.
You can insert breadcrumbs placeholder in an open master page. The placeholder shows the automatically generated breadcrumbs at the time of generation of Help topic. The breadcrumbs are generated based on the TOC.
You can insert a Mini TOC in a topic or a master page. The Mini TOC placeholder shows the automatically generated Mini TOC at the time of generation or preview of a topic. You can define the exact location and format of the Mini TOC while designing the layout of the master page. You can also customize the heading levels as required.
To insert a Mini TOC in an open topic or master page:
-
To apply inline formatting, in the General tab, do the following:
For Type: Mini TOC Caption
- Click Make list collapsible to collapse the Mini TOC.
- Edit the default caption, Contents, in the Caption field.
- Use various Font options to change the font family, style, size, color, and more.
- Use the Background options to change the background shade, and add and customize the dimensions of the background image.
For Type: Mini TOC List
- In the Use Headings field, use the from and to drop-downs to customize the heading levels. The default range of heading levels is 2 – 4. You can include heading 1 also.
- Clear the Show TOC in expanded form field if you do not want to view the TOC in expanded form.
- Use various Font options to change the font family, style, size, color, and more.
- Use the Background options to change the background shade, and add and customize the dimensions of the background image.
-
To apply a style from your style sheet, in the Styles tab, do the following:
For Type: TOC Caption
- Select Paragraph Styles from the styles drop-down list.
- From the list of styles, select a style to apply it.
For Type: TOC Body
- Select List Styles from the styles drop-down list.
- From the list of styles, select a style to apply it.
Uwaga:
You can also add twisty images to the Mini TOC Caption.
You can insert system or project variables, such as date, time, project title and more, as fields in an open topic or master page. Fields are read-only, and not customizable.
To insert a field in an open topic or master page:
You can insert a symbol in an open topic or master page. To do so, click the Insert Symbol icon in the standard toolbar, and select a symbol from symbols displayed. The selected symbol is inserted at the location of the pointer.
While creating a topic, you can associate it with a master page. For more information, see Create a topic.
You can associate an existing topic with a master page by editing the topic's properties. For more information, see Set topic properties.
You can create a duplicate copy of a master page with a different name and modify it to suit your requirements.