Customize chapter in toc
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 7
- Joined: Fri Mar 23, 2018 1:16 pm
Customize chapter in toc
Hello,
Context : Oxygen XML Editor 20, transformation WYSIWYG with custom CSS and Oxygen PDF Chemistry.
I got some informations about the toc customization here : https://www.oxygenxml.com/doc/versions/ ... %2Ccontent
1) Is it possible to customize only every chapter of the toc and not all the toc?
2) Is it possible to add, below each chapter in the toc, the short description of the topic?
Regards
Context : Oxygen XML Editor 20, transformation WYSIWYG with custom CSS and Oxygen PDF Chemistry.
I got some informations about the toc customization here : https://www.oxygenxml.com/doc/versions/ ... %2Ccontent
1) Is it possible to customize only every chapter of the toc and not all the toc?
2) Is it possible to add, below each chapter in the toc, the short description of the topic?
Regards
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Customize chapter in toc
Hello,
1) The following is an example of customizing the font size for the items representing chapters. The chapters are level one topics and are marked in the merged DITA document TOC with the "is-chapter" attribute:
2) You need to make a change in the XSL pipeline as we filter shortdesc information from the TOC. For this open the OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT2.x/plugins/com.oxygenxml.pdf.css/xsl/post-process-toc.xsl and remove the XSL template:
In the next oXygen release, this template will be deactivated by default.
Then, in your customization css add the following CSS selector:
In case you need all the TOC items short descriptions to be visible, remove the "is-chapter" condition.
Many regards,
Dan
1) The following is an example of customizing the font size for the items representing chapters. The chapters are level one topics and are marked in the merged DITA document TOC with the "is-chapter" attribute:
Code: Select all
*[class ~= "map/topicref"][is-chapter = "true"] > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"]{
font-size:2em;
}
Code: Select all
<xsl:template match="opentopic:map//*[contains(@class, ' map/shortdesc ')]"/>
Then, in your customization css add the following CSS selector:
Code: Select all
*[class ~= "map/topicref"][is-chapter = "true"] > *[class ~= "map/topicmeta"] > *[class ~= "map/shortdesc"] {
display:block; /* The default is none - the shortesc is hidden. */
color:gray;
}
Many regards,
Dan
-
- Posts: 7
- Joined: Fri Mar 23, 2018 1:16 pm
Re: Customize chapter in toc
Hello,
1) Works perfectly
2) Works also but a strange problem appears : all the <ph> tag in the shortdesc induce a line break. Is there a reason ? I also tried with <text> but same behaviour.
Thanks,
Arnaud
1) Works perfectly
2) Works also but a strange problem appears : all the <ph> tag in the shortdesc induce a line break. Is there a reason ? I also tried with <text> but same behaviour.
Thanks,
Arnaud
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Customize chapter in toc
Hello,
Indeed, the children of the shortdesc are considered blocks. This is a bug - a side effect from the fact we considered the topicmeta elements at any level to be blocks.
I corrected it, the fix will enter the next oXygen version.
As a workaround, please add to your CSS the following snippet:
Many regards,
Dan
Indeed, the children of the shortdesc are considered blocks. This is a bug - a side effect from the fact we considered the topicmeta elements at any level to be blocks.
I corrected it, the fix will enter the next oXygen version.
As a workaround, please add to your CSS the following snippet:
Code: Select all
*[class ~= "map/shortdesc"] * {
display:inline;
margin:0;
}
Dan
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service