Turning off collapsible sections in wehbelp
Turning off collapsible sections in wehbelp
webhelp.show.expand.collapse.sections
The default is yes. This parameter is not mentioned on this help page:
https://www.oxygenxml.com/doc/versions/ ... put-2.html
Thanks,
Mark
Re: Turning off collapsible sections in wehbelp
The parameter you have indicated refers to the Expand/Collapse All Sections button located next to the navigation links. Please see the screen-shot below:
- ExpandCollapse.png (1.15 KiB) Viewed 5333 times
Unfortunately, there isn't a way to turn off collapsible sections from the WebHelp output. I have logged this as an improvement request to our issue tracking took to be further analyzed by our development team.
Regards,
Ionela
oXygen XML Editor and Author Support
Re: Turning off collapsible sections in wehbelp
Code: Select all
<reference id="r_wf_blah" xml:lang="en-US">
<title>Configuration</title>
<shortdesc>blah blah</shortdesc>
<refbody>
<table frame="none" id="table_o3p_wfs_33b">
<tgroup cols="2">
<colspec colname="c1" colnum="1" colwidth="2*"/>
<colspec colname="c2" colnum="2" colwidth="1*"/>
<thead>
Thanks
Re: Turning off collapsible sections in wehbelp
I have just updated the issue that we have logged in our internal tracking system with your latest feedback.
Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
Re: Turning off collapsible sections in wehbelp
I checked and the status of the issue in our system still appears as "open". We will notify this thread when an implementation will become available.
As we did not have many request for this (removing the collapsible sections from the output), most probably this won't be implemented in the short term, but we still consider this for the long term versions.
Kind Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
-
- Posts: 918
- Joined: Thu May 02, 2019 2:32 pm
Re: Turning off collapsible sections in wehbelp
Post by chrispitude »
Code: Select all
/* hide the expand/collapse button for tables */
table > caption > .wh_expand_btn {
display: none;
}
-
- Posts: 38
- Joined: Thu Jul 29, 2021 12:02 pm
Re: Turning off collapsible sections in wehbelp
Post by InspectorSpacetime »
To remove all expansion buttons, just use
Code: Select all
.wh_expand_btn {
display: none;
}
Now, to get rid of the empty space or indentation that remains and looks a bit silly, for all items you can use
Code: Select all
.sectiontitle:not(.tasklabel), .topic:not([role~=article])>.title, .wh_term_group>.wh_first_letter, table>caption {
padding-left: 0em;
}
Code: Select all
h2 {
padding-left: 0em !important;
}
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
And sorry, maglid, for hijacking this thread. Hopefully you've either figured out the CSS hack already or will be interested in trying these latest suggestions.
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
I ended up suppressing the display of all elements that use the wh_expand_btn class. While I was at it, I hid the permalink icon by way of the opacity setting:
Code: Select all
.permalink {
opacity: 0;
}
Thanks again!
-
- Posts: 918
- Joined: Thu May 02, 2019 2:32 pm
Re: Turning off collapsible sections in wehbelp
Post by chrispitude »
CSS rules with more selectors have more "specificity" and thus take precedence:
CSS - Specificity
so if you set the display property back to its regular value for the desired objects, that should take precedence over the no-object rule.
For CSS selectors of the same specificity, later rules take precedence over earlier rules. To avoid ambiguity, I would put the general hide rule first, then the object-specific unhide rules after.
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
I was able to get collapsibles to reappear for the section I want by adding this to my custom CSS file:
Code: Select all
div > section > h3 > .wh_expand_btn {
display: inline;
}
Also, after re-enabling collapsibles where I want them to appear, how do I replace the padding whitespace that I removed using this suggestion from InspectorSpacetime:
Code: Select all
.sectiontitle:not(.tasklabel), .topic:not([role~=article])>.title, .wh_term_group>.wh_first_letter, table>caption {
padding-left: 0em;
}
-
- Posts: 38
- Joined: Thu Jul 29, 2021 12:02 pm
Re: Turning off collapsible sections in wehbelp
Post by InspectorSpacetime »
Like you already noticed, your current solution makes the expand button visible for all h3 elements, not just the ones you want.
Maybe a better solution would be something like this: For the sections you want to be collapsible, add a certain outputclass attribute value in the section's title in your DITA content. Something like this:
Code: Select all
<section id="section_fs3_nlb_3xb">
<title outputclass="show_collapse">A title</title>
<p>Lorem Ipsum...</p>
</section>
Code: Select all
.show_collapse > .wh_expand_btn {
display: inline;
}
Code: Select all
.show_collapse {
padding-left: 0.7em !important;
}
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
Does anyone know if it's possible to have these collapsible sections of mine default to collapsed instead of expanded? Thanks much.
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
I've done a browser inspect of the few elements that I do want to start in a collapsed state (and for which I made the collapse/expand buttons visible), but I can't figure out what I might need to override within my custom CSS file to get the behavior I want. Can anyone point me in the right direction? Any insight would be much appreciated.
-
- Posts: 38
- Joined: Thu Jul 29, 2021 12:02 pm
Re: Turning off collapsible sections in wehbelp
Post by InspectorSpacetime »
This is really stretching CSS, but you could try something like this:
Code: Select all
section:has(h3:not(.show_collapse)) > p {
display: block !important;
}
A couple of things to note: You might need to do multiple of these for different header levels, so the same code for h2, h3, h4 etc...
This CSS also assumes that your collapsed content is a p element, so if that's not always the case, you probably need to modify it to cover more element types.
And I'm not sure if the nested :has and :not selectors are supported by all browsers, so this is not a safe bet by any means...
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
The sections that I want to be collapsible/expandable (starting in a collapsed state) contain nested p and ul elements. If I give the outermost section element an id attribute like id="my_collapsible" can I somehow get it to do what I want?
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
I want none of my WebHelp output topics (HTML) to have collapsible sections except for a few that get transformed from specific DITA <section> elements to which I've added an outputclass="my_collapsible" attribute. For example:
Code: Select all
<section outputclass="my_collapsible">
<!-- THE SECTION'S TITLE SHOULD ALWAYS BE DISPLAYED ALONG WITH EITHER A ">" OR "V" ICON TO ITS LEFT -->
<title>Muh title</title>
<!-- THE REST OF THESE ELEMENTS SHOULD BE HIDDEN UNLESS THE USER EXPANDS THE HTML SECTION -->
<p>Paragraphs and lists in an arbitrary order</p>
<ul><li>List item</li><li>List item</li></ul>
<p>Paragraphs and lists in an arbitrary order</p>
<p>Paragraphs and lists in an arbitrary order</p>
<ul><li>List item</li><li>List item</li></ul>
<p>Paragraphs and lists in an arbitrary order</p>
</section>
Code: Select all
section.my_collapsible:has(p, ul) {
display: block !important;
}
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
Code: Select all
section.my_collapsible > h3 > .wh_expand_btn {
display: block !important;
padding-right: 0.7em !important;
}
- The padding-right: 0.7em; style doesn't seem to add the space that I want between the collapsible's button (">" or "V" depending) and the h3's text. Not sure what to do there.
- I want these collapsible elements to start in a collapsed state, but setting the webhelp.topic.collapsible.elements.initial.state transformation parameter to collapsed makes almost everything on every page disappear (other than section titles).
-
- Posts: 33
- Joined: Tue Mar 03, 2020 11:15 pm
Re: Turning off collapsible sections in wehbelp
Post by doctissimus »
Something like h3:not(.my_collapsible) oughta work, but I don't know what actual style to apply to get those elements to override the collapsed value of webhelp.topic.collapsible.elements.initial.state.
Code: Select all
h3:not(.my_collapsible) {
?
}
-
- Posts: 38
- Joined: Thu Jul 29, 2021 12:02 pm
Re: Turning off collapsible sections in wehbelp
Post by InspectorSpacetime »
Re: Turning off collapsible sections in wehbelp
I wanted to ask if this improvement is still planned. Fiddling (a lot) with CSS might be a solution. But in general people would expect the expand/collapse parameter to turn collapsible sections off entirely and not only hide the button. The expand/collapse arrows make the website look very cluttered and ugly and absolutely noone uses them (except on a page with many question-answer pairs). Users rather rely on the table of content to left or right.
So this improvement would be really helpful.
Kind regards
im_rem
Re: Turning off collapsible sections in wehbelp
I also logged your latest feedback on the issue we have in our tracking system and tried to prioritize it.
We will reply back to this thread if a different implementation would become available.
Regards,
Costin
oXygen XML Editor and Author Support
-
- Posts: 596
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Turning off collapsible sections in wehbelp
Post by julien_lacour »
Oxygen 27.0 is out, in this version we have improved the collapsible elements display when enabling webhelp.show.expand.collapse.sections.
Regards,
Julien
Return to “DITA (Editing and Publishing DITA Content)”
- 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