Linking Heading and TOC Style

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
doc_writer
Jr. Propeller Head
Posts: 8
Joined: Tue Nov 26, 2024 7:55 am

Linking Heading and TOC Style

Post by doc_writer »

Hi! I’ve created a new style for the Part Title heading, formatted as a sub-heading under H1. This heading is correctly linked to H1. Now, I’d like to link the Part Title to TOC1_parttitle_bold, a new TOC style I’ve created. In short, I need different formatting and alignment in the TOC.

Could someone explain how I can link a heading to a TOC style?

Thanks in advance!
Psider
Propellus Maximus
Posts: 902
Joined: Wed Jul 06, 2011 1:32 am

Re: Linking Heading and TOC Style

Post by Psider »

If you're using a HTML5 Tripane skin you can create a Toc Entry class in the skin and then apply that class to the specific entry in your TOC. But that functionality isn't available in Side Nav or Top Nav as far as I'm aware.

Otherwise, more information about what your trying to achieve in the output would help.
Psider
Propellus Maximus
Posts: 902
Joined: Wed Jul 06, 2011 1:32 am

Re: Linking Heading and TOC Style

Post by Psider »

Oh, nevermind, the toc entry class is not only just for tripane, it's also only the icons.

So let us know more about what you're trying to achieve and we can see if we can think of anything. :)
doc_writer
Jr. Propeller Head
Posts: 8
Joined: Tue Nov 26, 2024 7:55 am

Re: Linking Heading and TOC Style

Post by doc_writer »

Hi! I've set up autonumbering for headings (H1–H5) and now want to insert part titles between them. Ideally, the structure should look like this:

Part 1: ...
1 Topic 1
1.1 Sub-topic 1
1.1.1 ...
1.1.1.1 ...
1.1.1.1.1 ...

Part 2: ...
2 Topic 2
2.1 ...
2.1.1 ...
...

I need the part titles to appear in the Table of Contents (TOC) in bold, but without numbering. I tried applying a different TOC style for part titles but couldn't figure out how to link it to the part title heading style (which I formatted without autonumbering).
Psider
Propellus Maximus
Posts: 902
Joined: Wed Jul 06, 2011 1:32 am

Re: Linking Heading and TOC Style

Post by Psider »

I'm assuming the Part 1, etc are added in the TOC only and don't appear in any topic?

If so, I found this thread:
viewtopic.php?p=136974&hilit=toc+entry+styles#p136974

The tl;dr is 1) create a toc entry style in a Tripane skin, just so the style appears in the dropdown list in the Toc Entry Properties dialog box - your target can still use a Side or Top Nav skin. 2) Then add a style to your primary project stylesheet to style the "a" tag for toc entries with your custom style.

e.g.

Code: Select all

.Part_Style a {
    color: pink!important;
}
The simple test I did required !important on the color property, but try the properties you need without it first. The icon examples in the thread don't need important, because they aren't being set elsewhere, so depending on what you want to do, "important" might not be needed.
Post Reply