##### 14.8.6.4 Customizing and linking to the index file

To include a link to the index from the TOC, and to provide code to customize index features:

    [Inserts]
    ; IndexHead is within the index-file <head> element, after <title>.
    ; IndexTOC is inserted at the end of the TOC.
    ; IndexTop is at the top of the index-file body, after any JS link.
    ; IndexBottom is at the bottom of the index-file body.

For example:

    [Inserts]
    IndexTOC=<$IndexTOCEntry>
    IndexTop=<$IndexHeader>

If you set [Inserts]IndexTOC to your own code or macro, DITA2Go uses your code, instead of generating built-in code with the value of IndexTOCClass (default IndexTOC) as class and IndexFileTitle (default Index) as content. This means your code must specify class and content of the link from the TOC to the index. You can reference the index file with predefined macro variable $$_indexfilename:

    [IndexTOCEntry]
    ; Link from the TOC to the index:
    <H2 align="left" class="PartTOC">
    <a href="<$$_indexfilename>">Index</a></H2>

    [IndexHeader]
    ; A roll-your-own title for the index (see d2html_macros.ini):
    <H2 align="left" class="IndexHeaderClass">Index</H2>
    <br /><br />

For other index specifications DITA2Go provides Use* settings, so if (for example) you want your own heading to replace the one DITA2Go generates, you would set UseIndexHeading=No and assign code or a macro to [Inserts]IndexTop.

See also:

§14.9.5 Mapping indexterms to variant indexes

§27.6.2 Assigning code to [Inserts] keywords for splits and extracts

§37.3.4 Using predefined macro variables.

Previous Topic: 14.8.6.3 Specifying CSS classes for index components

Next Topic: 14.9 Configuring variant booklist components

Parent Topic: 14.8.6 Configuring index features for HTML output

Sibling Topics:

14.8.6.1 Choosing the type of index to generate for HTML

14.8.6.2 Specifying a file name and suffix for the index

14.8.6.3 Specifying CSS classes for index components