Add Title to Mini TOC
Add Title to Mini TOC
Hi,
I would like to be able to have a title print above my mini TOC automatically. Is this possible to do via styles or some other method?
For example, I want to generate a mini TOC like this:
Contents of this section:
Item 1......page 5
Item 2......page 6
Would I have to type the "Contents of this section:" everytime or can I automate that?
I am interested in doing this for both printed and webhelp output.
Thanks!
Jesse
I would like to be able to have a title print above my mini TOC automatically. Is this possible to do via styles or some other method?
For example, I want to generate a mini TOC like this:
Contents of this section:
Item 1......page 5
Item 2......page 6
Would I have to type the "Contents of this section:" everytime or can I automate that?
I am interested in doing this for both printed and webhelp output.
Thanks!
Jesse
Re: Add Title to Mini TOC
There's no way to automate it as part of the mini-TOC (at least, I don't think so), but you could put the text in a snippet or a variable and just insert that snippet or variable in every topic containing a mini-TOC. It's not automated in that it's not inserted automatically but the text will be the same everywhere and if you want to change it then you just change it in one spot and it'll change in all locations.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Add Title to Mini TOC
thanks. that sounds like a good idea
Re: Add Title to Mini TOC
OK, so I made a snippet that I use for my mini toc title. Is there a way that I can put the same border around the snippet and the mini-toc?
thx
thx
Re: Add Title to Mini TOC
Forgot to mention that you could put that mini-TOC inside the snippet with that text. Then you just insert the entire snippet into a topic.
As for putting a border around it, I suggest you put the text and the proxy inside the same DIV tag in the snippet and specify a border for that DIV tag in the stylesheet. If you're outputting to Word, though, you might have to use a <p> tag instead, since Word doesn't like the DIV tag. I think PDF output understands what to do with DIVs, but I haven't tested that out yet.
As for putting a border around it, I suggest you put the text and the proxy inside the same DIV tag in the snippet and specify a border for that DIV tag in the stylesheet. If you're outputting to Word, though, you might have to use a <p> tag instead, since Word doesn't like the DIV tag. I think PDF output understands what to do with DIVs, but I haven't tested that out yet.
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Add Title to Mini TOC
Yep, I do this in my projects - it took me a while to figure out, but it worksjessemds wrote:I would like to be able to have a title print above my mini TOC automatically. Is this possible to do via styles or some other method?
You'll need to add these styles in your stylesheet:
Code: Select all
MadCap|miniTocProxy
{
mc-auto-number-format: 'Contents of this section:';
mc-auto-number-class: miniTocBoxTitle;
}
span.miniTocBoxTitle
{
font-weight: bold;
}
div.MCMiniTocBox
{
mc-auto-number-format: 'Contents of this section:';
mc-auto-number-class: miniTocBoxTitle;
}- If you want to change the formatting of the title, edit the span.miniTocBoxTitle style.
Note: One slight problem is that it's not easy to add spacing between the title and the links underneath, as you can't use margins or padding with the span style. However, if you set the line-height property of the span, that will add space above and below the title.
Re: Add Title to Mini TOC
Hi,
David..your answer is amazing but I just have a few questions:
When I edit the McAutoNumberFormat property of the MadcapMinitocproxy, the caption does not change. When I edit the Mc-auto-number-format property of the McMini-Toc-Box DIV tag, that changes the caption. However, what property (if any) in the McAutoNumberFormat links the McMiniTocProxy to use the auto-number-format property of the McMini-Toc-Box DIV tag?
If that sounds too confusing, all I want to be able to do is to create additional MadCapMiniTOCProxy classes, one that I can use to display "Contents of this chapter" and one that will display "Contents of this section".
Thanks!
Jesse
David..your answer is amazing but I just have a few questions:
Here is exactly what I want to do. I want to have two snippets...one called MiniTocChapter and one called MiniTocSection. The MiniTocChapter should have a caption that reads "Contents of this chapter" and the other should read "Contents of this section".- If you want to change the title text, edit both references for the mc-auto-number-format property.
- If you want to change the formatting of the title, edit the span.miniTocBoxTitle style.
When I edit the McAutoNumberFormat property of the MadcapMinitocproxy, the caption does not change. When I edit the Mc-auto-number-format property of the McMini-Toc-Box DIV tag, that changes the caption. However, what property (if any) in the McAutoNumberFormat links the McMiniTocProxy to use the auto-number-format property of the McMini-Toc-Box DIV tag?
If that sounds too confusing, all I want to be able to do is to create additional MadCapMiniTOCProxy classes, one that I can use to display "Contents of this chapter" and one that will display "Contents of this section".
Thanks!
Jesse
Re: Add Title to Mini TOC
If you want two different styles of mini-TOC proxy, then set them up as classes of MadCap|miniTocProxy, e.g. MadCap|miniTocProxy.name.
The corresponding DIV class should use an underscore followed by the class name, e.g. div.MCMiniTocBox_name.
So, you might have something like:
On your master page(s), you can select which class of miniTocProxy to use.
The corresponding DIV class should use an underscore followed by the class name, e.g. div.MCMiniTocBox_name.
So, you might have something like:
Code: Select all
MadCap|miniTocProxy.chapter
{
mc-auto-number-format: 'Contents of this chapter:';
mc-auto-number-class: miniTocBoxTitle;
}
MadCap|miniTocProxy.section
{
mc-auto-number-format: 'Contents of this section:';
mc-auto-number-class: miniTocBoxTitle;
}
span.miniTocBoxTitle
{
font-weight: bold;
}
div.MCMiniTocBox_chapter
{
mc-auto-number-format: 'Contents of this chapter:';
mc-auto-number-class: miniTocBoxTitle;
}
div.MCMiniTocBox_section
{
mc-auto-number-format: 'Contents of this section:';
mc-auto-number-class: miniTocBoxTitle;
}-
ChuckJulian
- Propeller Head
- Posts: 14
- Joined: Tue Sep 09, 2008 3:40 pm
- Location: Penacook, New Hampshire
Re: Add Title to Mini TOC
Thanks, all. I was also trying to figure out how to put a heading over the miniTOC and forgot to ask the forum.
I added a couple of tweaks to the auto format code to make the heading the same color as my <h1>. I hope it's useful to others.
Chuck Julian
I added a couple of tweaks to the auto format code to make the heading the same color as my <h1>. I hope it's useful to others.
Code: Select all
mc-auto-number-format: '{b}{color #000099}Topics in this section:{/color}{/b}';
Chuck Julian
Re: Add Title to Mini TOC
If you're using the styles in my example, then you just need to edit the span.miniTocBoxTitle class to change the heading style - e.g. in your case:ChuckJulian wrote:Thanks, all. I was also trying to figure out how to put a heading over the miniTOC and forgot to ask the forum. :oops:
I added a couple of tweaks to the auto format code to make the heading the same color as my <h1>. I hope it's useful to others.
Chuck JulianCode: Select all
mc-auto-number-format: '{b}{color #000099}Topics in this section:{/color}{/b}';
Code: Select all
span.miniTocBoxTitle
{
font-weight: bold;
color: #000099;
}Re: Add Title to Mini TOC
I just wanted to say thanks for this code. This code and this program is EXACTLY what I need! 
-
peterbrown05
- Propeller Head
- Posts: 52
- Joined: Fri Jun 18, 2010 9:08 am
Re: Add Title to Mini TOC
this may help some people;
if flare v7 it turns out the div class has changed slightly;
I needed to do this to get it to work (and stay back compatible):
does anyone know if this is a bug or intended behaviour?
cheers
pete
if flare v7 it turns out the div class has changed slightly;
I needed to do this to get it to work (and stay back compatible):
Code: Select all
MadCap|miniTocProxy,
MadCap|miniTocProxy_0
{
mc-auto-number-format: 'Contents of this section:';
mc-auto-number-class: miniTocBoxTitle;
}
cheers
pete
Re: Add Title to Mini TOC
It's a difference in Flare v7, quite a lot of generated style classes now have '_0' added to their name.peterbrown05 wrote:does anyone know if this is a bug or intended behaviour?
I've posted a list here: http://forums.madcapsoftware.com/viewto ... =6&t=12550
It's not a bug as such, as these are all Flare's generated styles; so it's only a problem if you're tweaking them.
This change will probably effect quite a number of tweaks posted in the forums.
Re: Add Title to Mini TOC
Incidentally, adding an auto number format to MadCap|miniTocProxy will only affect what you see in the Flare editor, and is not carried into the output; setting the auto number format on the div.MCMiniTocBox styles will include it in the actual output.
You need to add the _0 to div.MCMiniTocBox, not MadCap|miniTocProxy as mentioned above.
E.g.
You need to add the _0 to div.MCMiniTocBox, not MadCap|miniTocProxy as mentioned above.
E.g.
Code: Select all
div.MCMiniTocBox,
div.MCMiniTocBox_0
{
mc-auto-number-format: 'Contents of this section:';
mc-auto-number-class: miniTocBoxTitle;
}
-
atomdocs
- Sr. Propeller Head
- Posts: 308
- Joined: Tue Jun 18, 2013 3:00 am
- Location: Eastern Seaboard, Thailand
- Contact:
Re: Add Title to Mini TOC
Thanks Dave. If I put this on my masterpage (set at target level), the div autonumber does not turn off when the miniTOC is suppressed (because of no child topics). Is that your understanding also, or have I made an error along the way?
Tom
Flare 2022, Capture 7

Flare 2022, Capture 7

Re: Add Title to Mini TOC
In my projects, the miniTOC only appears in the output when a topic has child topics; if the topic doesn't have child topics, it does not include a div.MCMiniTocBox.atomdocs wrote:If I put this on my masterpage (set at target level), the div autonumber does not turn off when the miniTOC is suppressed (because of no child topics). Is that your understanding also, or have I made an error along the way?
-
atomdocs
- Sr. Propeller Head
- Posts: 308
- Joined: Tue Jun 18, 2013 3:00 am
- Location: Eastern Seaboard, Thailand
- Contact:
Re: Add Title to Mini TOC
Thanks Dave. It's not working for me. I assumed the miniTOC proxy goes inside the MCMiniTocBox div on the masterpage, is that right?
In output, I get the MCMiniTocBox div autonum text in every topic, whether or not there are child topics.
I'm also not clear why the miniTOC proxy needs autonum properties - I found I get the same result if I remove these properties from the proxy.
I am creating HTML5 output, I wonder if this is an issue?
In output, I get the MCMiniTocBox div autonum text in every topic, whether or not there are child topics.
I'm also not clear why the miniTOC proxy needs autonum properties - I found I get the same result if I remove these properties from the proxy.
I am creating HTML5 output, I wonder if this is an issue?
Tom
Flare 2022, Capture 7

Flare 2022, Capture 7

Re: Add Title to Mini TOC
No, you just insert the miniTOC proxy on the master page, you do not insert a div.atomdocs wrote:Thanks Dave. It's not working for me. I assumed the miniTOC proxy goes inside the MCMiniTocBox div on the masterpage, is that right?
The div.MCMiniTocBox is generated by Flare in the output - it turns the miniTOC proxy into the div, and we're just modifying the div's style in the CSS.
Mentioned in one of my posts below...atomdocs wrote:I'm also not clear why the miniTOC proxy needs autonum properties - I found I get the same result if I remove these properties from the proxy.
Dave Lee wrote:Incidentally, adding an auto number format to MadCap|miniTocProxy will only affect what you see in the Flare editor, and is not carried into the output; setting the auto number format on the div.MCMiniTocBox styles will include it in the actual output.
-
atomdocs
- Sr. Propeller Head
- Posts: 308
- Joined: Tue Jun 18, 2013 3:00 am
- Location: Eastern Seaboard, Thailand
- Contact:
Re: Add Title to Mini TOC
Thanks Dave. Got it. I read the rest the of this topic properly this time. I just needed _0.
Tom
Flare 2022, Capture 7

Flare 2022, Capture 7

Re: Add Title to Mini TOC
I see this topic is old but I found a simpler method for adding a title to the mini TOC. I use the before selector:
Of course, support for the ::before selector was limited in 2008 and there may be some older browsers that don't support it but I'm okay with it not showing up in those browsers.
For some reason, I couldn't get the auto-numbering described earlier to work in my project.
Code: Select all
div.miniToc::before
{
content: "More:";
font-weight: bold;
}For some reason, I couldn't get the auto-numbering described earlier to work in my project.
Re: Add Title to Mini TOC
Amygil, if you do that, is there any way to style that introductory text in CSS? Thanks.
Re: Add Title to Mini TOC
Stupid question, never mind.