Page 1 of 1

Expand/collapse text

Posted: Thu Jun 13, 2019 9:48 pm
by Carl
Is there an easy way to hide a block of text so that you can reveal/collapse it by clicking a link? This was easy to do in Flare, but I've gone in circles trying to find out how to do this in OxygenXML.

Re: Expand/collapse text

Posted: Fri Jun 14, 2019 10:52 am
by sorin_carbunaru
Hello Carl,

Are you asking about the text from the editing area (Text page or Author page) or about the text in the published output (for example WebHelp)?

Best wishes,
Sorin Carbunaru
oXygen XML

Re: Expand/collapse text

Posted: Wed Jun 19, 2019 8:07 pm
by Carl
Hello. I am asking about text in the WebHelp output.

Re: Expand/collapse text

Posted: Fri Jun 21, 2019 10:45 am
by ionela

In the WebHelp Responsive output we have implemented for the expand/collapse feature. Our implementation is targeted on components that have a title. The title will act as a toggle button and it will always remain visible while the rest of the component will be collapsed/expanded. The expand-collapse widget is rendered before the title. The expand-collapsed state will actually be toggled by clicking only on this widget (not on the title's text).

We have 4 categories of components that match this pattern:
  • nested topics (to have nested topics you need to set chunk="to-content" attribute on the parent topic
  • sections that have a title
  • tables that have a title
  • index terms groups

Here is an example from our user-manual with a topic that contains collapsible elements:Publishing Template Package Contents


Re: Expand/collapse text

Posted: Thu Mar 05, 2020 1:56 pm
by syed

Can you tell me what needs to be done to make any other element like Note and Table collapsible?


Re: Expand/collapse text

Posted: Thu Mar 05, 2020 5:07 pm
by Costin

The support that we have implemented in WebHelp for the expand/collapse functionality is not extensible, so it is not possible to have expand/collapse functionality also for notes and all tables, by default.

However, even if I could not tell exactly how that should look like, probably you could achieve that through your own Javascript customization.
For more details on how to include JavaScript code into custom HTML fragments that could be used to customize the WebHelp Responsive output, see this section from the User-Guide.