Make Toolbar Prev/Next buttons match TOC used in Menu Proxy?

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
lc4466
Propeller Head
Posts: 26
Joined: Tue Jun 18, 2019 10:20 am

Make Toolbar Prev/Next buttons match TOC used in Menu Proxy?

Post by lc4466 »

Hi all. I'm trying to set up a master page that includes both a toolbar with prevtopic/nexttopic buttons (or back/forward, I've tried both) and a menu proxy that uses a separate TOC from the main target toc (I'm using sidenav html skin). The issue is that the toolbar buttons keep defaulting to the main target toc page sequence rather than using the toc I've specified for the menu proxy.

Basically, I want buttons that will move the user through the page sequence shown in the menu proxy. Anyone know if there's a to achieve what I'm describing with out of box flare functionality (or using javascript if that's what's needed)?
lc4466
Propeller Head
Posts: 26
Joined: Tue Jun 18, 2019 10:20 am

Re: Make Toolbar Prev/Next buttons match TOC used in Menu Proxy?

Post by lc4466 »

I think for my use case what I actually need is the eLearning Toolbar proxy, but the issue is the same. It's still using the target toc and there doesn't seem to be a way to identify a different toc to use.
scap
Propeller Head
Posts: 55
Joined: Tue Jun 28, 2022 7:36 am

Re: Make Toolbar Prev/Next buttons match TOC used in Menu Proxy?

Post by scap »

lc4466
Propeller Head
Posts: 26
Joined: Tue Jun 18, 2019 10:20 am

Re: Make Toolbar Prev/Next buttons match TOC used in Menu Proxy?

Post by lc4466 »

Verified with Flare support that no out of box functionality exists for this. So I think my answer has to be javascript. In trying to research existing code I could tweak, I found this partial code from a similar question on Stack Overflow that creates an array of all the urls in the page (in my case would add the appropriate class to just pull the urls from the menu proxy) and then finds the current pages place within the array to create the prev/next functions. Unfortunately it's just the individual pieces, it’s not actually written out into a functional script:

Code: Select all

var links = Array.prototype.slice.call(document.querySelectorAll('.linkClass a'));
var index = links.indexOf(currentFocus);
// nextLink = links[index - 1];
// previousLink = links[index + 1];
I don’t actually know enough to write this into a script I can use, I’m only familiar enough with js to steal/tweak existing scripts. Any chance someone here can help me put this together into a functional script?
Post Reply