DITA Definition Entries and Dropdowns
Description
Definition Term items are configured via Options as Dropdown -> Start closed.
This works, except that if there is content which occurs after the definition list, it may get included in the last dropdown in the definition list.
Possible Solution
Mark the start/end of definition list entries via @markopen and @markclose in default.wwconfig. Then use the new style names to control dropdown display.
Mark DITA Definition List Entries
This requirement can be accomplished by creating an override to the DITA styles configuration file:
Formats\Adapters\xml\scripts\dita\default.wwconfig
We add a new style rule for ' topic/dlentry ' elements with the @markopen and @markclose attributes:
<!-- Mark open/close on definition entries --> <!-- --> <Style match="//*[contains(@class, ' topic/dlentry ')]"> <xsl:variable name="VarName" select="'Definition List Entry'" /> <wwditaconfig:Head name="{$VarName}" markopen="{$VarName} Open" markclose="{$VarName} Close" /> </Style>
This will preserve the location of the start/end of the <dlentry> container element.
Fix Dropdown Behavior via Style Designer
Next, we scan our source DITA map an configure styles as follows:
DITA Element |
Paragraph Style Name |
Changes |
<dt>...</dt> |
Definition Term |
Options -> Dropdown -> Start closed |
<dlentry> |
Definition List Entry Open |
Options -> Generate output -> Disabled |
</dlentry> |
Definition List Entry Close |
Options -> Dropdown -> Break |
This configuration ensures dropdowns are correctly closed out during processing. It also ensures the placeholder paragraph is ignored by the browser when rendered in a browser.
Example Project
The above changes are implemented in the attached project Definition Lists.zip.