Sections and Subsections have same header format

Topics: Developer Forum, User Forum
Jul 6, 2014 at 12:56 PM
When I write conceptual documentation so that I have subsections, the first header and the second header are of the same type. This makes it difficult to read. Only the third subsection then uses a different formatting (I'm building web pages using the Vs2013 style with SHFB 2014.05.31.0). How do I fix this, so that sub-sections are visually different?

An example in my .aml file:
<section>
  <title>MyTitle</title>
  <sections>
    <section>
      <title>Subtitle</title>
      <content><para>Test</para></content>
      <sections>
        <section>
          <title>SubSubtitle</title>
        </section>
      </sections>
    </section>
  </sections>
</section>
MyTitle and Subtitle look the same and both use in HTML
<span class="collapsibleRegionTitle" ...>Title</span>

and
<span class="collapsibleRegionTitle" ...>Subtitle</span>

and the HTML structure "knows" that Subtitle is a sub-title as I can collapse Title removing Subtitle. I had hoped I can simply override the CSS, but if they have the same span class, then this isn't possible.
Coordinator
Jul 6, 2014 at 6:27 PM
The HTML structure doesn't know it's a subtitle. It's simply a collapsible section within another collapsible section. Collapsing the parent hides the content including the subsections so there's nothing special going on. Ideally what needs to happen is that the XSL transformations need to pass the template that renders the collapsible section a parameter indicating whether or not it's a top level section or a subsection and alter the CSS accordingly perhaps based on the level up to a certain point perhaps disabling the collapsible behavior after a certain level is reached.

Eric
Jul 6, 2014 at 6:33 PM
Is that something that's in principle easy to do? I don't know anything about how to create/modify XSL (and a bit of CSS). What would be the relevant XSL file and where would I start looking? Am I right if it doesn't sound like something supported out of the box?
Coordinator
Jul 6, 2014 at 7:13 PM
The transformations would have to be modified. The two templates in question are t_putSection and t_putSectionInclude found in globalTemplates.xsl. It could get rather complicated as the content to render in the section is passed to the templates so determination of the level would most likely occur elsewhere and may need a global variable to track the current level. Otherwise you'd have to change how the sections are rendered entirely. This is just speculation as I haven't looked too closely into implementing this.

Eric