Expand TOC by default
-
- Propeller Head
- Posts: 85
- Joined: Wed Mar 21, 2007 3:01 am
- Location: Belgium
- Contact:
Expand TOC by default
I have a very small project that opens with an introduction topic on the top level of my TOC. All other topics are arranged as child nodes under this intro topic.
When the help is launched, it opens the intro and leaves the TOC collapsed, so that you initially only see the intro in the TOC. I would however like to expand the TOC by default, so that the whole doc structure is visible immediately.
How can I do that?
When the help is launched, it opens the intro and leaves the TOC collapsed, so that you initially only see the intro in the TOC. I would however like to expand the TOC by default, so that the whole doc structure is visible immediately.
How can I do that?
-
- Propellus Maximus
- Posts: 840
- Joined: Mon May 01, 2006 10:11 am
- Location: Inside California
Re: Expand TOC by default
The TOC isn't expanded by default, but if your default topic is located in a lower level book, that book will be expanded when the help is opened, if Auto-Sync TOC is enabled.
Richard Ferrell
Certified Madcap Trainer
Certified Madcap Trainer
-
- Propeller Head
- Posts: 85
- Joined: Wed Mar 21, 2007 3:01 am
- Location: Belgium
- Contact:
Re: Expand TOC by default
Yeah, I thought of that as a workaround too. It's a pity though there's no real option to control the expand/collapse TOC for an online target. I think I'll submit a feature request for it.
Thanks, Richard.
Thanks, Richard.
-
- Propellus Maximus
- Posts: 1028
- Joined: Thu Apr 12, 2007 7:28 am
- Location: Wilmington, DE
- Contact:
Re: Expand TOC by default
Another option I thought of was to not use any folders and just put all the "child" books on the first level. I think it would be ok considering how small you said the project was. Just clearly label the first topic as Introduction (and you can still make it open by default).
Laura A. Castle
http://www.lauracastle.com
http://www.lauracastle.com
-
- Propeller Head
- Posts: 85
- Joined: Wed Mar 21, 2007 3:01 am
- Location: Belgium
- Contact:
Re: Expand TOC by default
Problem is that I always create a top-level topic with a short intro and a mini-TOC proxy. So I can't place that on the same level as the child topics, because the mini-toc wouldn't contain any links.
-
- Propeller Head
- Posts: 57
- Joined: Tue Nov 06, 2012 11:53 am
- Location: Denver, CO, USA
- Contact:
Re: Expand TOC by default
I would love to see an option somewhere for the site builder to set the ToC to be expanded by default, with a ++ and -- icon on the page itself so the user can expand all / contract all if they want to.
-
- Senior Propellus Maximus
- Posts: 2089
- Joined: Tue Mar 07, 2006 5:06 pm
- Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
- Contact:
Re: Expand TOC by default
Lodge bug and enhancement requests herejbkalla wrote:I would love to see an option somewhere for the site builder to set the ToC to be expanded by default, with a ++ and -- icon on the page itself so the user can expand all / contract all if they want to.
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Re: Expand TOC by default
Does anyone know if this functionality is available in Flare 10? I've looked but can't find it. But technically it has to be possible, because the book containing the startup topic is always expanded by default. I just want the whole TOC to be expanded by default (it's a very small TOC).
Re: Expand TOC by default
I'm looking for the answer about Flare 10 as well! I'd like the TOC book folders to default to expanded when the TOC opens.
-
- Senior Propellus Maximus
- Posts: 3669
- Joined: Thu Feb 02, 2006 9:57 am
- Location: Pittsford, NY
Re: Expand TOC by default
I don't think there is such an option. 'Least, I've never come across it...Kathy_123 wrote:I'm looking for the answer about Flare 10 as well! I'd like the TOC book folders to default to expanded when the TOC opens.
Nita
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
-
- Propeller Head
- Posts: 68
- Joined: Fri Aug 22, 2014 12:24 pm
Re: Expand TOC by default
No, it is not a default feature in Flare. Yes, it is technically possible (via JavaScript). When I get less busy I'll try to see how much JS is needed to do this.
Re: Expand TOC by default
Did you ever figure out the JavaScript needed to do this? I have the same requirement as everyone else - my TOC needs to be expanded when the project opens. It would seem that this is a pretty standard requirement for many folks.
Re: Expand TOC by default
I figured out a workaround in JavaScript. I think the problem is that the elements don't actually exist in the HTML until you open up a book icon in a TOC. It must then go away and retrieve the related topics.
This code works by simulating a click on each top-level book. It runs when you double-click the Contents tab:
window.onload = function() {
// Open first level when double-click on TOC tab.
$("#TocTab").dblclick(function() {
var topNodes = document.getElementsByClassName("tree")[0].childNodes;
for (var i = 0, l = topNodes.length; i < l; i++) {
topNodes.click();
}
// Go back to home topic
window.location.assign('#');
});
}
Click the Edit button on the Toolbar tab of the skin and paste this code into it.
Hope this helps some people. It only opens the first level of topics, but with a bit more fiddling you could get it to open further levels.
This code works by simulating a click on each top-level book. It runs when you double-click the Contents tab:
window.onload = function() {
// Open first level when double-click on TOC tab.
$("#TocTab").dblclick(function() {
var topNodes = document.getElementsByClassName("tree")[0].childNodes;
for (var i = 0, l = topNodes.length; i < l; i++) {
topNodes.click();
}
// Go back to home topic
window.location.assign('#');
});
}
Click the Edit button on the Toolbar tab of the skin and paste this code into it.
Hope this helps some people. It only opens the first level of topics, but with a bit more fiddling you could get it to open further levels.
Re: Expand TOC by default
PS.
This does not work in Flare V11. To get it to work, the line where the click is simulated should be changed to:
topNodes.childNodes[0].click();
This does not work in Flare V11. To get it to work, the line where the click is simulated should be changed to:
topNodes.childNodes[0].click();
Re: Expand TOC by default
I tried this and the change that makes it work in Flare 11. However, when I double-click on the Contents label, I get returned to the topic container. When I re-access the TOC, the first-level heads are expanded, as described.
But why is it shooting me out to the topic container first?
But why is it shooting me out to the topic container first?
Re: Expand TOC by default
Hi Madcaps,
Since I originally found this question time has moved on. I am still at 10.2 and the code provided above does not expand the TOC in the navigation pane. Does anyone have any other solutions - and does v12 offer this as a configurable setting?
thank you..................... liz
Since I originally found this question time has moved on. I am still at 10.2 and the code provided above does not expand the TOC in the navigation pane. Does anyone have any other solutions - and does v12 offer this as a configurable setting?
thank you..................... liz
Re: Expand TOC by default
Thanks, I hadn't noticed this had stopped working. For some reason, the click event on the TOC nodes has changed to a div inside the li node, so now you have to simulate the click on the div instead of the li element. I'm not sure when this happened. That's the thing with JavaScript; browser updates and Flare updates can stop things working. Still, it's better than not being able to open the TOC in one go.
For later versions, this should work:
window.onload = function() {
// Open first level when double-click on TOC tab.
$("#TocTab").dblclick(function() {
var topNodes = document.getElementsByClassName("tree")[0].childNodes;
for (var i = 0, l = topNodes.length; i < l; i++) {
ob=topNodes.firstChild;
ob.click();
}
window.location.assign('#');
});
}
Note, this only applies to tripane HTML5 and it works with Flare 12. If you already have the window.onload section in your code then don't add it again. This also applies to the last brace (})
@damadeo - I'm not sure why you're getting that. Mine seems fine. I'm not sure what you mean by having to re-access the TOC.
For later versions, this should work:
window.onload = function() {
// Open first level when double-click on TOC tab.
$("#TocTab").dblclick(function() {
var topNodes = document.getElementsByClassName("tree")[0].childNodes;
for (var i = 0, l = topNodes.length; i < l; i++) {
ob=topNodes.firstChild;
ob.click();
}
window.location.assign('#');
});
}
Note, this only applies to tripane HTML5 and it works with Flare 12. If you already have the window.onload section in your code then don't add it again. This also applies to the last brace (})
@damadeo - I'm not sure why you're getting that. Mine seems fine. I'm not sure what you mean by having to re-access the TOC.
-
- Propeller Head
- Posts: 23
- Joined: Tue May 03, 2016 12:04 pm
- Location: Simi Valley, CA
Re: Expand TOC by default
Thanks, GaryUK, that worked great. However, I agree with jbkalla that there should be an option to expand the TOC by default. So, heading to the feature request page.
Brian
Brian
Flare ( ) v12, Windows 10