Filter conditions based on TOC folder?

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
lhguillory
Jr. Propeller Head
Posts: 5
Joined: Tue Sep 15, 2015 12:57 pm

Filter conditions based on TOC folder?

Post by lhguillory »

I document a JSON API that has 3 versions of most requests/responses. About 85% of the information is identical among the versions. If there is a difference, I write around it ("In version 2, XYZ returns 5 options"). As the product grows, the differences between v1 and v3 are becoming numerous, making it more difficult to read about a feature when you have to parse out 2 other versions. Ideally, I would like the table of contents to have books for v1, v2, and v3, then set conditions on those books such that, when built, v3 TOC book excludes v1 and v2 conditions. These settings would not affect the search but that's okay.

Has anyone come up with a solution for excluding content based on TOC settings?

The first solution relies on the user selecting the version they want. The solution is based on this page: https://techwritersblog.com/madcap-flar ... cap-flare/
filter.png
The downside is that the version selection isn't persistent between pages, so the user has to reselect the version for each page. A better solution seems to be on this page, but the technical implementation is beyond my abilities: https://www.madcapsoftware.com/blog/how ... e-project/

The second solution is to build 3 targets that each filter different content; create a landing page for the project with links to all 3 outputs, where the user selects which version to view; then add links to the masterpage that allow users to switch among versions. This solution creates 3 folders that duplicate 85% of the shared content.
merge.png
Hoping someone has a more elegant solution.
You do not have the required permissions to view the files attached to this post.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Filter conditions based on TOC folder?

Post by NorthEast »

lhguillory wrote:The downside is that the version selection isn't persistent between pages, so the user has to reselect the version for each page.
But doesn't the first solution that you linked to already handle this?
https://techwritersblog.com/madcap-flare-category/version-filters-madcap-flare/
According to that page it will remember what you selected (using myFunction).
lhguillory
Jr. Propeller Head
Posts: 5
Joined: Tue Sep 15, 2015 12:57 pm

Re: Filter conditions based on TOC folder?

Post by lhguillory »

The instructions say that it does keep the version. However, it does not. Each new page opens with Version 3 filter applied.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Filter conditions based on TOC folder?

Post by NorthEast »

I had a quick look at that example, and it's got a mistake - because the myFunction() function is never being run by anything. That function checks if you've previously selected an option (by looking in local storage), and either applies the option you selected or the default option of "Default.Version 3" (which you can change to whatever).

So at the top of the script, outside of the other functions, add this line:

Code: Select all

myFunction();
Post Reply