Adding headings to miniTOCs

This article applies to: ePublisher Professional

It explains how to: add a heading to your miniTOCs and then format that heading, as shown below:

miniTOChead01.png

Because some project modifications cannot be made through the GUI, you use project format overrides to add and format headings in miniTOCs.

There are three major steps:

  1. Creating format overrides
  2. Adding miniTOC headings
  3. Formatting miniTOC headings

1. Creating format overrides

To create a format override, first choose an existing format target in your project (e.g., WebWorks Help 5.0). Next, create a directory structure that mirrors the directory path to the file that you will be overriding.

Note: If you have already created format overrides for this project (e.g., to modify breadcrumbs, or to format your company details on each page), some or all of the following may be unnecessary).

  1. In ePublisher Pro, select the existing format target from your project.

    For example, if you chose WebWorks Help 5.0 as the format when creating this project you will already have a target that, by default, is named WebWorks Help 5.0. WebWorks Help 5.0 is the Active Format Target in the screenshot below.

    ActiveFormat.jpg

Create a new Targets directory in your ePublisher project directory

  1. Open your existing ePublisher Pro project if it is not already open.
  2. Select View > User Files to open a Windows Explorer window.

  3. Navigate up one level to the directory where your .wep ePublisher Pro project file is located.
  4. Create a new folder named Targets.

    Note: The directories ePublisher Pro looks for are case-sensitive. Be sure to type the folder names exactly the way they are typed in the installation directory structure.

    TargetOverride02.jpg

  5. Open the Targets directory you just created.
  6. Create a new folder and give it the name of the Format Target you have selected in your project (e.g., WebWorks Help 5.0).

  7. Open the Format Target directory you just created. Leave this window open.
  8. Open a second Windows Explorer window and navigate to the Formats folder located in the directory where you installed WebWorks ePublisher Pro. By default, it is located in C:\Program Files\WebWorks\ePublisher Pro\Formats.

  9. Within the Formats directory, open the directory of the format on which you have based the format target chosen in Step 1 (e.g., \Formats\WebWorks Help 5.0\). Leave this window open.

  10. To add a miniTOC heading and then format it, you need to find, copy and paste two override files and their folders into your project:
    • content.xsl
    • webworks.css

Add an override content.xsl file to your project

  1. In the Explorer window you left open at Step 10 (showing your ePublisher program files), navigate to C:\Program Files\WebWorks\ePublisher Pro\Formats\WebWorks Help 5.0\Transforms\content.xsl.

  2. Right-click content.xsl and choose Copy.

  3. In the Explorer window you left open at Step 8 (showing your project), add the following new folders to your project:

    Targets\WebWorks Help 5.0\Transforms\ It should now look something like:

  C:\Documents and Settings\user\Documents\WebWorks\Projects\MyProject\Formats\WebWorks Help 5.0\Transforms\
  1. Paste content.xsl (copied at Step 13) into the new Transforms directory.

    Note: It is not necessary to copy any files into the project Formats directory that you are not explicitly overriding.

Add an override webworks.css file to your project

  1. In the Explorer window you left open at Step 13 (showing your ePublisher program files), navigate to C:\Program Files\WebWorks\ePublisher Pro\Formats\WebWorks Help 5.0\Pages\css\webworks.css.

  2. Right-click webworks.css and choose Copy.

  3. In the Explorer window you left open at Step 14 (showing your project), add the following new folders to your project: \Pages\css It should now look something like:

  C:\Documents and Settings\user\Documents\WebWorks\Projects\MyProject\Formats\WebWorks Help 5.0\Pages\css
  1. Paste webworks.css (copied at Step 17) into the new css directory.

    Note: It is not necessary to copy any files into the project Formats directory that you are not explicitly overriding.

2. Adding miniTOC headings

  1. Navigate to the override copy of content.xsl that you created in:

 C:\Documents and Settings\user\Documents\WebWorks\Projects\MyProject\Formats\WebWorks Help 5.0\Transforms\
  1. Open content.xsl with a text editor, and jump to the following section (which starts at about line 530):

  <xsl:template name="MiniTOC">
  <xsl:param name="ParamSplit" />
  <xsl:param name="ParamTOCEntry" />
  <xsl:param name="ParamEmitTOCEntry" />
  <xsl:param name="ParamMiniTOCSubLevels" />
  <xsl:if test="($ParamEmitTOCEntry = true()) or
  (count($ParamTOCEntry/wwtoc:Entry[1]) = 1)">
   <html:div class="WebWorks_MiniTOC">
    <!-- Emit top-level entry? -->
  1. Open a new line after:

  <html:div class="WebWorks_MiniTOC">
  1. Add the div class name you intend to use for the heading style, followed by the text to be used (the second, third and fourth lines below):

 <html:div class="WebWorks_MiniTOC">
  <html:div class="MiniTOCHeading">
  In this section
  </html:div>
  <!-- Emit top-level entry? -->
  1. Save and close content.xsl, then complete the steps in Formatting miniTOC headings, below.

3. Formatting miniTOC headings

  1. Navigate to the override copy of webworks.css that you created in:

    C:\Documents and Settings\user\Documents\WebWorks\Projects\MyProject\Formats\WebWorks Help 5.0\Pages\css\

  2. Open webworks.css with a text editor, and open a new line above the div.WebWorks_MiniTOC section (which starts at about line 26).

  3. Add your formatting requirements (ensuring that you use exactly the same div class name that you entered in content.xsl). For example:

  div.MiniTOCHeading
  {
     color: #0000CC;
     font-family: Verdana, Arial, Helvetica, Sans-Serif;
     font-size: 11pt;
     font-weight: bold;
     margin-bottom: 4pt;
  }
  1. Save and close webworks.css.
  2. Generate your project and check for errors in the output.

jjj 27.10.06

List of pages in this category:


Display context of search results
Case-sensitive searching


HelpCenter/Tips/AddingHeadingsToMiniTOCs (last edited 2008-02-13 06:18:26 by localhost)