Hiding entries from the main_page_toc of a tree transformation

Post here questions and problems related to editing and publishing DITA content.
LAN101
Posts: 8
Joined: Thu Jun 13, 2024 5:15 pm

Hiding entries from the main_page_toc of a tree transformation

Post 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
Radu
Posts: 9431
Joined: Fri Jul 09, 2004 5:18 pm

Re: Hiding entries from the main_page_toc of a tree transformation

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
LAN101
Posts: 8
Joined: Thu Jun 13, 2024 5:15 pm

Re: Hiding entries from the main_page_toc of a tree transformation

Post 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
You do not have the required permissions to view the files attached to this post.
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: Hiding entries from the main_page_toc of a tree transformation

Post 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
LAN101
Posts: 8
Joined: Thu Jun 13, 2024 5:15 pm

Re: Hiding entries from the main_page_toc of a tree transformation

Post by LAN101 »

Hi Julien,
thank you very much!
Your solution works really well :D
Kind regards
Rosaria
Post Reply