White space is added in the ToC where the element is "display:none"

paulkhillier
Posts: 15
Joined: Wed Jun 27, 2018 12:44 am

White space is added in the ToC where the element is "display:none"

Post by paulkhillier » Thu Jan 21, 2021 9:29 pm

Hello Oxygen Experts,

I am experiencing issues hiding 3rd level map/topicref/navtitle elements from the ToC generated through PDF Chemistry. ToC hierarchy is as follows:

Level 1: Part (hidden) - The navititle is "System Changes" and acts as a container for all chapters/topicrefs. We need to keep this structure to support downstream processes (e.g. Conversion to a filterable Excel list of Defects/System Changes,
Level 2: Chapter (displayed visually like level 1)
Level 3: child topicref of chapter (hidden)

We are updating our PDF Chemistry CSS Transforms to support capture of our individual XML topics related to individual Promote Request (PROM) records in ServiceNow. We want to hide child topic with PROM in the title/filename as these are already captured as a "footnote" to each individual topic.

Code implemented to achieve this is as follows:

Code: Select all


/* Hide System Changes (Part) from TOC */

*[class ~= "map/topicref"][is-part] > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"] {
    display: none;

}

/* Chapter as Module TOC Style */

*[class ~= "map/topicref"][is-chapter]:not([is-part]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"] {
	font-size: 12pt;
	font-weight: normal;
	color: #6aade4;
 	padding-top: none;
      padding-bottom: none;
      padding-left: 0;
}

/* Hide PROM from TOC - NOT WORKING CORRECTLY, ADDS WHITE SPACE DEPENDING ON NUMBER OF PROMS */

*[class ~= "map/topicref"]:not([is-part]):not([is-chapter]) > *[class ~= "map/topicmeta"] > *[class ~= "topic/navtitle"] {
  display: none;
  margin: 0px 0px 0px 0px;
  padding: 0px 0px 0px 0px;

}

Issue: White space is added in the ToC where the PROMXXXXXX <title> element would otherwise be displayed (see screen shot). The expected behavious is that "display:none" would remove the element, leaving no white space, What happens instead is that variable white space is added depending on the # of child topics. For example, "Commissions - Split" has one child topic, while "Cycle Processing" has 6 child topics.

Screen Shot: https://photos.app.goo.gl/nJELp3oxWD826H8w5

Is there a more effective way to achieve the desired result, so the white space between entries on the ToC are consistent? Or, is this an issue with the PDF processor that is either "as designed" or a known issue/defect?

Please advise, and let me know if any further details are required,

Regards,

Paul Hillier
IFDS Canada

julien_lacour
Posts: 166
Joined: Wed Oct 16, 2019 3:47 pm

Re: White space is added in the ToC where the element is "display:none"

Post by julien_lacour » Fri Jan 22, 2021 3:32 pm

Hello Paul,

Instead of hiding the navtitle of your PROM entries from the TOC, you should try to hide all the <topicref> containing them:

Code: Select all

*[class ~= "map/topicref"]:not([is-part]):not([is-chapter]) {
  display: none;
}
Regards,
Julien

paulkhillier
Posts: 15
Joined: Wed Jun 27, 2018 12:44 am

Re: White space is added in the ToC where the element is "display:none"

Post by paulkhillier » Fri Jan 22, 2021 5:37 pm

Success! Thank you for the code example.

Post Reply