Do you have online help that serves multiple types of audiences? Do you want to give your user the freedom to choose the version of the help?
If you have these questions in your mind and thinking how to achieve it in Madcap Flare then, this post is for you. In this post, I will provide you a step-by-step guide to create a dropdown filter in Madcap Flare.
I am using Condition tags, a little bit of Javascript, and Windows session storage property of HTML5 output.
In the madcap flare, a conditional tag set saves conditions for your project. You can have multiple conditional tag sets in a project and one conditional tag set can have multiple conditions. You can use conditions to generate show/hide content and generate multiple outputs in one project. However, in this post, we will use conditions for the user to show hide content.
You can apply conditions to topics, images, stylesheet, glossary, skin, target files, entire paragraphs, and text within paragraphs. table rows and columns, table of contents (TOC) entries, glossary terms, index keyword markers, and more.
Adding a Javascript into a madcap Flare project is simple. You can add a Javascript code in madcap Flare but you cannot create a Javascript file in Flare. You can create a separate Javascript file using a text editor, save it with a .js extension, and then link it into your project. You can add the Javascript code or link a Javascript file into a topic, a snippet, or a master page. We will add our javascript code directly to our master page. This code will filter the content based on the value selected by user from our version filters drop-down list.
Hello Lori, Thank you for reading and trying out the version filters!
As correctly pointed out by Dave Lee, there was an error in the JS that I wrote. I have updated the post with the correct JS code, you can try now and let me know if you still face any issue.
Sorry, I do not have any site that has this implemented. This was just a proof of concept that I worked on. Since, it was interesting and can be helpful for someone in need, I thought it will be worth sharing here.
Sorry, there was one minor error in the JS code that I wrote. Because of this error the version filter was not applying the default value and was not saving the selected filter. I have updated this page with the corrected JS code and its working for me. You should try once again and if you still find any issue, feel free to comment again. I will be happy to help you.
Hello, I know this some what of an old article now but I just came across it. I got it to work but if I swap to say version 3 there is a big gap on the topic where version 1 and 2 information is. Is there anyway round this?
Hello Robin,
I would suggest you check how you have applied the Conditions (conditional tags) in Madcap Flare. One of the reasons, I could think for your issues is that you have applied the conditions on the text and not the entire paragraphs. So, when you switch to version 3, there are empty paragraphs left on the page.
Hi, thanks in advance for your help. I have tried using this method of versioning and when I open the newly generated html file, I can see the dropdown menu but the conditional text does not change no matter what I select in the dropdown menu. I have three test paragraphs, each of them has a different condition set on it and all three are not being displayed at all when I choose different versions in the dropdown menu. What could be the problem here?
Is this possible if we have different source files and the content is posted on different locations. Is there a limitation that all content has to be there in a single source file with proper conditional texting for this to work.
I am not sure, if I get your question correctly. If the content is not in a single source file, why would you need a dynamic filter?
This version filter is simply a show and hide button, where the content for the selected version is shown and rest all are hidden. However, all the content is available in the same HTML page. If you are keeping everything separately, then you do not need a filter. You can simple create a hyperlink/button, which will redirect the user to the right content.