TechNote 10008: Creating a header across many topics using topic style content
Topic styles can be used to create headers in topics which can be used in
multiple topics, for example in the HyperText Studio help file:
This TechNote describes how to replicate this heading in your own projects.
Note: This TechNote assumes that you already know
how to create a topic style with content as described in TechNote
10007: Creating and using a topic style with content.
Creating the content
A table will be used to display the heading bar across the top.
- Create a topic style and open it for editing.
- Remove any existing content from the topic.
- Create a table using Insert | Table, filling in the values as below.:
Making code changes
- To add some of the settings we wish to apply to the table we must now make
some changes to the HTML source. Click .
- Place the cursor just before the > after <table.
- Press the space bar and a menu will appear.
- From the menu select bgcolor.
- When the next menu appears, select Color...
- In the color dialog, enter the color as #336699
and click OK.
- Type in the following code before the >, which displays a thin
border after the heading:
solid; border-bottom-color: black; border-bottom-width: 1px".
Setting page defaults
The table as it is looks to far from the border of the page. To change
that we will change some of the topic properties.
- Go back to Design view by clicking on the
- Select Topic | Properties.
- Go to the Margin tab.
- Type 0
as the value for the Left and Top options.
- Press Enter.
Formatting the text
It would be useful to have the HyperText Studio automatically insert the title
of our topic. This can be done by using the Title Field. Each topic
using the topic style will then use their own title in their page.
- Press CTRL+HOME to go to the start of the topic.
- Select Insert | Field.
- Ensure that Title is selected.
- Click OK.
- Click on the newly inserted field to select it.
- From the Formatting toolbar, click the color button .
- From the drop-down select white as the color.
- Add any other formatting you wish to use.
Creating the editable region
Now that our heading is setup we need to create an editable region for each
topic's text to be placed in.
- Press CTRL+END to go to the end of the topic.
- Select Format | Editable Regions | New
- Type the name you wish to use for your editable region into the dialog.
- Click OK.
- Select File | Save to save the changes to the topic style.
This will automatically update any topics currently using this style.
Now you can apply your new topic style to any topic in your project to see
the results of your work!