Button to reload help with other version of help

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
deeptikorwar
Sr. Propeller Head
Posts: 111
Joined: Tue Aug 20, 2013 11:38 pm

Button to reload help with other version of help

Post by deeptikorwar »

Hi,

I have two versions of the help to cater to audiences using different versions of the software.

I currently have two different targets and I am producing separate online help for each version. The user has to select the version of help on the Home page.

Is it possible to add a button on each topic (via skin, masterpage) and when the user clicks the button, they should be able to switch to the other version of the help.

Has anyone had such a situation before? Is there a solution to this?

Thanks,
Deepti
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Button to reload help with other version of help

Post by RamonS »

You can add a button in the tool bar that runs javascript to open the designated URL of the other system. You can add custom buttons in the skin in the Toolbar tab. There is an add button below the list of available buttons. The add dialog refers to adding a new style (bug?), but all it does is add a new button to the list of available buttons for the tool bar. Once added move it over to the selected buttons and put in the desired spot. After that switch to the Styles tab and find the section "Topic". At the very end of that section you will now see the entry for the button that you added. Expand the node to see all the items you can configure. Most of them are for making the button look pretty and you do want to add at least a glyph so that it is not a totally bare button, but the most important part is under "Event", which only exposes the click event (not much else to do with a button). Enter the js for opening the different version of the help.
From what I could tell after a minute online search (not a js expert), this is the command to use: http://www.w3schools.com/jsref/met_loc_replace.asp
That will replace the current tab content with the specified content. Use the URL method for opening WebHelp as described in the Flare manual to pass any additional parameters, such as topic file name (or alias or map ID), skin, etc.

Come to think....this will add a button to all topics and have them all go to the same target. You likely will need more js that picks out the current map ID or such so that you can send the user to the applicable topic in the other help version. As a quick fix you can use the above to send them to the start topic of the different version, which means that the user then has to navigate to the desired topic again.

Thinking a bit more...there really is no benefit to the user to get sent to the wrong version of the help in the first place. To really fix this, have the developers change the base URL for the help calls in each version of the software to go to the applicable help. If they implemented CSH properly it will be a one line change or nothing else than a config setting change. Makes me wonder why the users end up in the wrong help apparently that often that you feel the need to add buttons into the help to allow them to switch to the right version. It honors you that you want to help out the users, but the fix IMHO needs to be in the software, not the help.

HTH
deeptikorwar
Sr. Propeller Head
Posts: 111
Joined: Tue Aug 20, 2013 11:38 pm

Re: Button to reload help with other version of help

Post by deeptikorwar »

Thanks a lot Ramon for taking out so much time to respond to my query. I really appreciate your help.

Unfortunately, the application does not support CSH at the moment. It might in future versions of the product.

The help links are the same except for the version number. I mean, I am reusing most of the topics to generate content for both the versions. Only a few topics are valid for Version A but not for Version B.

After publish, the help links will be something like this, http://prod/Help/VersionA/Content/Folder A/Topic1.htm and http://prod/Help/VersionB/Content/Folder A/Topic2.htm

The parameter prod will vary based on the help server, that is, development or production. The depth of Folder A will vary based on the way the help topics have been organised.

So, the link will be the same for a particular topic on a help server except for the version number. The button in VersionA should toggle the link to VersionB and vice versa. There should be a page not found in version for topics that are not common across the versions.

This might require more JS coding than the basic stuff and I was hoping someone out here would have had a similar issue :)
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Button to reload help with other version of help

Post by NorthEast »

If you want a link to the same topic in another URL, then you could do something like this.

In target A, your master page could include a link to target B (a#prodB).
The script gets the current topic location (location.href) in product A, then replaces part of this URL so it points to product B instead, and then sets this URL as the href for the link.

So in your master page for product A:

Code: Select all

<p><a id="prodB">Link to Product B</a></p>

<script type="text/javascript">/*<![CDATA[*/
hrefProdB = location.href.replace("prod/Help/VersionA/", "prod/Help/VersionB/");
$('a#prodB').attr("href", hrefProdB);
/*]]>*/</script>
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Button to reload help with other version of help

Post by RamonS »

deeptikorwar wrote:Unfortunately, the application does not support CSH at the moment. It might in future versions of the product.
CSH or not, the devs ought to have one place where the link to the help is kept. Version A of the software should point to the help for that version, version B points to the other location. That way the user clicks the Help button in the app and gets the applicable version of the help. There is no benefit to show them any other version. While I understand what you are going for, I feel as if it is overengineered and does not really serve the users well when they get sent to the wrong help in the first place requiring them to notice that and then take action to remedy a condition that should not have occurred in the first place. Tell the devs to fix the URLs used in the software versions, CSH or not.
deeptikorwar
Sr. Propeller Head
Posts: 111
Joined: Tue Aug 20, 2013 11:38 pm

Re: Button to reload help with other version of help

Post by deeptikorwar »

Thanks a lot Dave!! That code works like beauty :D

Is there a way to add error handling to the script and display a customised text instead of the red page not found error. I mean, I don’t want users to get lost when the topic is not available and at least stay in the same version.

If above is not possible, I will create a snippet and include it in all topics where there is a corresponding topic in the other version. And a second snippet for topics where there is no other version to read topic does not exist in other version.

@Ramon I understand what you are saying. Most of the users access the new version of the product . Few users use Version A for some functions and Version B for all other functions. The link to the help is available within each version. The help is also available as a link in the Intranet to direct users to Business Continuity Plans (the plans are separate for each version) for use when the application is down. To cover-off users who are accustomed to using the Intranet link, I had to do this.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Button to reload help with other version of help

Post by NorthEast »

deeptikorwar wrote:Is there a way to add error handling to the script and display a customised text instead of the red page not found error. I mean, I don’t want users to get lost when the topic is not available and at least stay in the same version.
The example was just a basic script to get you started. Perhaps ask someone where you work for help with developing it further.
Post Reply