Chapter and Topic Nesting

Post here questions and problems related to editing and publishing DITA content.
SunilCP
Posts: 10
Joined: Wed Jan 04, 2023 8:44 am

Chapter and Topic Nesting

Post by SunilCP »

There is a map/ ditamap as follows :
image.png
When I add this as a chapter in bookmap and generate the PDF using css transformation, the output is as follows:
image.png
I wanted all the topics nested under the ditamap to be under one chapter "Introduction"
All the topics are set to @is-chapter = true, so all the topics are considered as chapters.
How to change the css to ensure that these topics are not considered as chapters, any thoughts?
You do not have the required permissions to view the files attached to this post.
julien_lacour
Posts: 668
Joined: Wed Oct 16, 2019 3:47 pm

Re: Chapter and Topic Nesting

Post by julien_lacour »

Hello,

This is a normal behavior, if you take a look at the DITA Specification for <mapref> element (same as setting format="ditamap") you will find:
The hierarchy of the referenced map is merged into the container map at the position of the reference...
One solution to create an additional level is to add a <topichead> element into the referred map:

Code: Select all

<map>
    <topichead navtitle="Introduction">
        <topicref href="installation_process_and_deliverables.dita"/>
        <topicref href="system_and_bios_requirements.dita"/>
        <topicref href="installation_process_and_deliverables.dita"/>
        <topicref href="installation_process_and_deliverables.dita"/>
    </topichead>
</map>
Regards,
Julien
chrispitude
Posts: 922
Joined: Thu May 02, 2019 2:32 pm

Re: Chapter and Topic Nesting

Post by chrispitude »

Building on Julien's suggestion, you can place the

Code: Select all

<topichead>
in either the submap file:

Code: Select all

<!-- chapter_submap.ditamap -->
<map>
    <topichead navtitle="Introduction">
        <topicref href="installation_process_and_deliverables.dita"/>
        <topicref href="system_and_bios_requirements.dita"/>
        <topicref href="installation_process_and_deliverables.dita"/>
        <topicref href="installation_process_and_deliverables.dita"/>
    </topichead>
</map>
or in the top-level map file:

Code: Select all

<!-- top.ditamap -->
<map>
    <topichead navtitle="Introduction">
        <mapref href="chapter_submap.ditamap"/>
    </topichead>
</map>
In either case (heading in the top-level map or in the submap), you can use a topic file instead of a <topichead> to provide the heading:

Code: Select all

<!-- chapter_submap.ditamap -->
<map>
    <topicref href="introduction.dita">
        <topicref href="installation_process_and_deliverables.dita"/>
        <topicref href="system_and_bios_requirements.dita"/>
        <topicref href="installation_process_and_deliverables.dita"/>
        <topicref href="installation_process_and_deliverables.dita"/>
    </topicref>
</map>

Code: Select all

<!-- top.ditamap -->
<map>
    <topicref href="introduction.dita">
        <mapref href="chapter_submap.ditamap"/>
    </topicref>
</map>
This provides an opportunity to provide a chapter abstract, brief overview of the content, etc.
SunilCP
Posts: 10
Joined: Wed Jan 04, 2023 8:44 am

Re: Chapter and Topic Nesting

Post by SunilCP »

Thanks for the suggestions. It works.
Post Reply