MiniToc "heading" can be made visible if links exist?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
peterbrown05
Propeller Head
Posts: 52
Joined: Fri Jun 18, 2010 9:08 am

MiniToc "heading" can be made visible if links exist?

Post by peterbrown05 »

Hello
I have MiniToc working for my online help and looks something like:
body text blah blah

Link1
Link2
Link3
Id like it to looks like this:
body text blah blah

You may be also interested in the following pages:
Link1
Link2
Link3
It is of course easy to add that text "You may be also interested in the following pages:" but for some pages, there are no related links and so in this case I'd like to "hide" the text "You may be also interested in the following pages:"

Is this possible and if so, how?

many thanks,

peteB
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: MiniToc "heading" can be made visible if links exist?

Post by LTinker68 »

Create a class for the mini-TOC and have that class set to not supply that text. Then apply that mini-TOC class to the topic where you don't want the text to appear.

If your mini-TOC proxy is in your masterpage, then you'll have to create a second masterpage and set its mini-TOC proxy to use the class you just created. You can associate that masterpage with an html class, and have the first masterpage associated with the base html tag. So all topics will use the base html tag and therefore the original masterpage, except those topics where you apply the html class to the topic. See this KB article for info on using multiple masterpages in your project --> http://kb.madcapsoftware.com/default_CSH.htm#FMP1001F
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
peterbrown05
Propeller Head
Posts: 52
Joined: Fri Jun 18, 2010 9:08 am

Re: MiniToc "heading" can be made visible if links exist?

Post by peterbrown05 »

..but this means that I need to "manually" set the class for each topic which have related links.
The links are "automatically" generated for each topic for me and obviously none are generated if they dont exist. I dont want to have to manually maintain when the heading text is displayed (or not)...

....or am I misunderstanding your suggestion>
many thanks
peteB
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: MiniToc "heading" can be made visible if links exist?

Post by LTinker68 »

You don't do anything for the links that appear in the generated output. You're just specifying a new class for the mini-TOC proxy when you put it in a topic. If you followed, I think it was Dave Lee's, instructions on how to automatically have that "You may also..." text added to the output, then you follow the same instructions except you don't specify an mc-auto-number-format for that class of the mini-TOC proxy. Once you have that class set up, the only thing manual you have to do is insert the mini-TOC proxy into a topic and specify or not specify a class for it, depending on if you want that text to appear or not.

BTW, just a head's up... If you set the base mini-TOC proxy style to insert that text, then you'll have to insert a blank space in place of the "You may also..." text in the mc-auto-number-format field of the new mini-TOC proxy class or open the stylesheet in the Internal Text Editor and use an empty set of single quotes ('') in the field. That's because the min-TOC proxy class will inherit the text from the base mini-TOC proxy class, and there's no way through Flare's Stylesheet Editor to set the mc-auto-number-format to "none" so that it won't inherit. So the only option is to put a blank space in the field or use empty single quotes in the stylesheet file.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
whunter
Sr. Propeller Head
Posts: 429
Joined: Thu Mar 12, 2009 4:49 pm
Location: Portland, OR

Re: MiniToc "heading" can be made visible if links exist?

Post by whunter »

I may be misunderstanding something, but I used Dave's instructions to put an "In this section:" header on my mini-toc, and it only displays if the mini-toc has links to show. The mini-toc is in the master page, not individual topics. I assumed the whole mini toc div was just ignored if there were no links for it.
peterbrown05
Propeller Head
Posts: 52
Joined: Fri Jun 18, 2010 9:08 am

Re: MiniToc "heading" can be made visible if links exist?

Post by peterbrown05 »

this sounds like what I need. I however can't find "Dave's instructions".
Can you inform how I add this text into the master page, or , point me to daves forum entry?
whunter
Sr. Propeller Head
Posts: 429
Joined: Thu Mar 12, 2009 4:49 pm
Location: Portland, OR

Re: MiniToc "heading" can be made visible if links exist?

Post by whunter »

LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: MiniToc "heading" can be made visible if links exist?

Post by LTinker68 »

whunter wrote:I may be misunderstanding something, but I used Dave's instructions to put an "In this section:" header on my mini-toc, and it only displays if the mini-toc has links to show. The mini-toc is in the master page, not individual topics. I assumed the whole mini toc div was just ignored if there were no links for it.
I missed the part about "if links exist". I don't know if the whole mini-TOC proxy is invisible or just not added to a topic if there are no links for it. I don't put the mini-TOC in the masterpage; I add it to the "intro" "books" where I want it to appear, so I only have it when I know I want it.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: MiniToc "heading" can be made visible if links exist?

Post by NorthEast »

LTinker68 wrote:I missed the part about "if links exist". I don't know if the whole mini-TOC proxy is invisible or just not added to a topic if there are no links for it. I don't put the mini-TOC in the masterpage; I add it to the "intro" "books" where I want it to appear, so I only have it when I know I want it.
The mini-TOC is only included in a topic when it is required, so it could be added to your master page.
You don't need to manually add it to topics, or have it in a separate master page.
peterbrown05
Propeller Head
Posts: 52
Joined: Fri Jun 18, 2010 9:08 am

Re: MiniToc "heading" can be made visible if links exist?

Post by peterbrown05 »

many thanks; the css in the referenced link above did the trick.

thanks for all your help. much appreciated.
peteB
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: MiniToc "heading" can be made visible if links exist?

Post by LTinker68 »

Dave Lee wrote:The mini-TOC is only included in a topic when it is required, so it could be added to your master page.
You don't need to manually add it to topics, or have it in a separate master page.
So even if you set it up so that it has "title" text, that title text won't appear unless there are links to go in the mini-TOC? That's cool. I only recently started playing with adding the "title" text and I didn't put the proxy in the masterpage because I figured that "title" text would show up regardless of whether or not there were links.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
peterbrown05
Propeller Head
Posts: 52
Joined: Fri Jun 18, 2010 9:08 am

Re: MiniToc "heading" can be made visible if links exist?

Post by peterbrown05 »

yes, correct. The "title" only is displayed if the minitoc has any links.

exactly what i needed. good job!
Post Reply