Conditionally hide the Menu Proxy

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
MPlatt
Propeller Head
Posts: 13
Joined: Mon Mar 02, 2015 10:20 am

Conditionally hide the Menu Proxy

Post by MPlatt »

I'm using the SideNav Template and I've also added a menu proxy to provide a topic content list based on the headings in the topic.
However, I would like to hide the proxy entirely if there is only the primary heading and no sub-headings.

I feel like this should be possible just with CSS but I can't figure it out.

Any thoughts?
AlexFox
Sr. Propeller Head
Posts: 162
Joined: Thu Oct 19, 2017 1:56 am

Re: Conditionally hide the Menu Proxy

Post by AlexFox »

You could perhaps count the elements on the page with jQuery .length and hide the menu with JavaScript if there are subheadings present?
Psider
Propellus Maximus
Posts: 816
Joined: Wed Jul 06, 2011 1:32 am

Re: Conditionally hide the Menu Proxy

Post by Psider »

I did this, I think - don't have Flare at the moment, by setting H1 to mc-heading-level: 0 in the MainStyles.css (I think that's the one for the skin?). It means that the H1 isn't included in your menu proxy so only the H2, H3 etc display. It there are no h2 etc, then no menu displays.

It may be a problem for print output, but it didn't seem to have any negative effect on the tripane toc, but I haven't checked top nav or side nav.
Post Reply