Synchronizing Navigation Elements With TOC Entries

If you generate HTML5 output, links to the TOC (e.g., menu items, breadcrumbs, mini-TOCs) are dynamically generated when a particular topic is opened. This lets you keep these navigation elements in sync with your TOC. This is particularly important if the same topic is linked to multiple entries in your TOC; otherwise, menu items and other navigation elements might display for one instance of that topic in the TOC when another instance is preferred.

For HTML5 Tripane output, navigation elements will always remain in sync with your TOC entries. However, for HTML5 Side Navigation, Top Navigation, and skinless outputs, you must enable a feature in your target to synchronize navigation elements with TOC entries.

How to Synchronize Navigation Elements With TOC Entries

  1. Open an HTML5 target used for Side Navigation, Top Navigation, or skinless output.
  2. On the Advanced tab of the Target Editor, select Synchronize navigation elements with TOC entries.
  3. Click Save the active file. to save your work.

Example You have a topic called “More Information” that is linked in two places in your TOC.

With the synchronization option disabled, you generate HTML5 Top Navigation output. You open the More Information topic under the “Procedures” menu, the second (and last) place that it occurs in the TOC file.

The topic opens, and initially everything seems fine. But if you look at a couple of navigation elements—the breadcrumbs and side menu—you will notice that the topic was opened in the first TOC location (under “Getting Started”). This is the default behavior; the first instance of the topic in the TOC will be shown, not necessarily the one you selected.

Therefore, you open the target and enable the option to synchronize navigation elements with TOC entries.

After generating the target once more, you open the output and select the More Information topic in the same way (in the Procedures menu). When you do this, notice that both the breadcrumbs and side menu are in sync with that location.

Pros and Cons

Synchronizing navigation elements with your TOC entries seems like an obvious decision, and for some authors it is. However, other authors might choose not to do this for their Side Navigation, Top Navigation, or skinless outputs. There are pros and cons.

Pros

Cons

The obvious advantage of this feature is in the name itself; it keeps elements synchronized with the TOC appropriately.

With this option enabled, you will notice that the URL paths for your topics are quite a bit longer and more complex.

With the option disabled, the paths are much more streamlined.

You do not need to worry if you have a topic linked to multiple TOC entries.

Note If you decide not to use this option for your HTML5 Side Navigation, Top Navigation, or skinless output but you are still concerned about having duplicate TOC links, there is a workaround. You can create a snippet that holds all of the content for the topic. Then create multiple topics (as many topics as you need links to it in the TOC), and insert that snippet into each one. Rather than linking to one topic in multiple places in the TOC, you can link to a different topic in each place. By doing that, your navigation elements will point to the appropriate locations. You probably want to disable searching in all but one of those topics; otherwise, they will all show up in the search results (see Including or Excluding Topics in Search).

 

Relationship to Option for Embedding Visible TOC Entries

This field for synchronizing navigation elements is related to the "Embed Visible TOC Entries" in the Skin Editor. For frameless output (HTML5 Side or Top Navigation) you can reduce "flicker" effects that users might see when clicking in the main table of contents (TOC) navigation. This can be done by selecting the "Embed Visible TOC Entries" option on the Setup tab of the Skin Editor. When this option is enabled, the top-level (i.e., parent) TOC items are preloaded (i.e., embedded) into the output topics. Because of this, the movement (or "flicker") when opening topics is less significant. See Reducing Flicker in Frameless TOC Navigation.

Even when you enable the "Embed Visible TOC Entries" option in the skin, the flicker effect is not reduced when clicking a duplicate TOC entry (other than the first instance). This might be more obvious when you have a Side Navigation configuration.