Page 1 of 1

Hiding entries from the main_page_toc of a tree transformation

Posted: Thu Mar 20, 2025 1:49 pm
by LAN101
Hi,
We have a main ditamap with several submaps. I want to be able to hide some entries or entire subtrees from the tree transformation scenario. Similar to hiding tiles in the tiles transformation scenario.
I have tried using the display=none with many of the classes. Athough I can hide all the topic titles and short descriptions, I cannot hide the empty accordeon itself.
Is there a way of hiding the expandable accordeon?

Kind regards
Rosaria

Re: Hiding entries from the main_page_toc of a tree transformation

Posted: Thu Mar 20, 2025 3:36 pm
by Radu
Hi Rosaria,
Is this about customizing the Oxygen DITA to WebHelp transformation? Or do you have your own DITA to HTML customizations?
Can you maybe add a screenshot with the stuff that you want to hide?
Regards,
Radu

Re: Hiding entries from the main_page_toc of a tree transformation

Posted: Thu Mar 20, 2025 4:00 pm
by LAN101
Hi Radu :D
yes, it is about the Oxygen Tree transformation, which we have adapted a little bit to our corporate identity.
Here is a screenshot of the tree and the hidden texts:
image.png
As you can see, I have managed to hide the texts (title, shortdesc) of the topics but could not get rid of the accordion.

Thank you for your help.
Kind regards
Rosaria

Re: Hiding entries from the main_page_toc of a tree transformation

Posted: Fri Mar 21, 2025 2:23 pm
by julien_lacour
Hello,

The simplest solution is to mark the submap with @toc="no attribute":

Code: Select all

<map>
    <title>Main</title>
    <mapref href="first/first.ditamap"/>
    <mapref href="second/second.ditamap"/>
    <mapref href="third/third.ditamap" toc="no"/>
    <mapref href="fourth/fourth.ditamap"/>
</map>
But this will remove the entry from the tree and the header.

If you just want to remove it from the tree you can do something similar to this:

Code: Select all

<map>
    <title>Main</title>
    <topichead navtitle="First">
        <mapref href="first/first.ditamap"/>
    </topichead>
    <topichead navtitle="Second">
        <mapref href="second/second.ditamap"/>
    </topichead>
    <topichead navtitle="Third" outputclass="no-tree">
        <mapref href="third/third.ditamap"/>
    </topichead>
    <topichead navtitle="Fourth">
        <mapref href="fourth/fourth.ditamap"/>
    </topichead>
</map>
Then in your custom CSS stylesheet you just need to match the entry having the "no-tree" class:

Code: Select all

.wh_main_page_toc_accordion_header:has(.no-tree) {
  display: none;
}
Regards,
Julien

Re: Hiding entries from the main_page_toc of a tree transformation

Posted: Fri Mar 21, 2025 3:30 pm
by LAN101
Hi Julien,
thank you very much!
Your solution works really well :D
Kind regards
Rosaria