##### 16.9.4.5 Modifying code for drop-down links

You can redefine any of the built-in drop-down link macros by changing the default code that is assigned to the macro name. Each macro name serves as a keyword in your project configuration file; you change the definition by assigning replacement code to the macro name. When you assign code to a macro name in the configuration file, the entire setting must be all on one line, even if it does not look that way here.

Ordinarily you should not need to include any of the settings described in this section.

Link ID prefix

Because an ID used in JavaScript must start with a letter, by default DITA2Go prefixes the incremental value of the drop-down link ID with drop. To change the drop-down link ID prefix:

    [DropDowns]
    DropIDPrefix = drop

Link macros

To change the code for creating drop-down links, include the following settings to redefine the built-in macros:

    [DropDowns]
    ; Default macros for link start/end:
    DropLinkStart = <a class="<$DropClass>"\n <$DropLinkAttr>>
    DropLinkAttr = href="javascript:doSection('<$$_DropID>');void 0;"
    DropLinkEnd = </a>

If you use DropLinkStart, include CSS for the text to match its content; also see:§16.9.6 Providing CSS for drop-down links and blocks:

    [DropDowns]
    DropLinkParaStart = <p class="<$DropClass>">
    DropLinkParaText = <$DropText>
    DropLinkParaEnd = </p>

<$DropLinkStart> follows <$DropLinkParaStart>. If DropLinkType=Icon, both icons follow <$DropLinkStart>. Unless DropLinkType=Button, next come <$DropLinkParaText> then <$DropLinkEnd>.

Icon macros

To change the code for drop-down icons:

    [DropDowns]
    DropOpenIcon = <img\n src="<$DropOpenIconFile>" id="io<$$_DropID>"   style="border:0;" alt="<$DropOpenIconAlt>">
    DropCloseIcon = <img\n src="<$DropCloseIconFile>" id="ic<$$_DropID>"   style="display:none;border:0;" alt="">\n

Button macros

To change the code for drop-down buttons:

    [DropDowns]
    DropButton = \n<button type="button" class="<$DropClass>" id=  "bu<$$_DropID>" <$DropButtonAttr>><$DropButtonOpenLabel></button>\n
    DropButtonAttr = onclick="doSection('<$$_DropID>')"

Text macro

To change the code for fixed-text links:

    [DropDowns]
    DropLinkPara = <p class="<$DropClass>">   <$DropLinkStart><$DropText><$DropLinkEnd></p>

Previous Topic: 16.9.4.4 Configuring text for drop-down links

Next Topic: 16.9.5 Configuring drop-down blocks

Parent Topic: 16.9.4 Configuring drop-down links

Sibling Topics:

16.9.4.1 Specifying the type of link for drop-down sections

16.9.4.2 Configuring icons for drop-down links

16.9.4.3 Configuring buttons for drop-down links

16.9.4.4 Configuring text for drop-down links

Table of Contents • Index