Showing the TOC in the Author view

Post here questions and problems related to oXygen frameworks/document types.
Posts: 40
Joined: Wed Jan 29, 2014 4:30 pm

Showing the TOC in the Author view

Post by Pascale » Thu Apr 24, 2014 6:02 pm


is there a way to generate a dynamic Table Of Content in the Author view of the Editor ?
By dynamic, I mean a tree of titles representing the structure of the book and where each title is an hyperlink to the corresponding section.

NB: using a custom DTD, not DITA but similar to Docbook


Posts: 829
Joined: Wed Nov 16, 2005 11:11 am

Re: Showing the TOC in the Author view

Post by alex_jitianu » Fri Apr 25, 2014 3:07 pm

Hi Pascale,

We don't have a way to dynamically generate such a Table of Content. Here is what you can do:
1. You can offer an alternative CSS that will render the entire document just like a Table of Content. The user will use the Styles button on the toolbar to switch to this TOC mode, position itself into the section it wants and then switch back to the full view mode.
2. Either in the CSS from 1. or in the default CSS you can write some rules based on a custom pseudo class. The idea is to only present a limited number of nodes (the TOC) and when a pseudo class is set to present all the content from that node. Here is an example on how you can do that for Docbook:

Code: Select all

/* All nodes (except titles) from a section not marked as in "edit.mode" will be hidden */
sect1:not(:-oxy-edit-mode) *:not(title), sect2:not(-oxy-edit-mode) *:not(title){
display:none !important;
/* On the title add a button form control. The author action invoked by the button will toggle a pseudo class named -oxy-edit-mode thus triggering the displaying/hiding of nodes. */
sect1 > title:after, sect2 > title:after{
content:oxy_button(actionID, 'edit.mode', transparent, true);
More on Custom Pseudo classes can be read here. There is also a video demonstration on how to use custom pseudo classes for progressive disclosure here

3. You could implement a

Code: Select all

custom form control
that present a Table of Content for the document, for example one based on a javax.swing.JTree. When the user clicks on a entry it can scroll to that section in the document. Care should be taken to refresh this form control when the structure of the document changes and the TOC should be regenerated.

Best regards,

Post Reply