Link from topic to corresponding topic in new target

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
DMilkes
Jr. Propeller Head
Posts: 7
Joined: Mon Jun 25, 2018 9:47 am

Link from topic to corresponding topic in new target

Post by DMilkes »

I am generating a skinless target for context-sensitive topics, each of which I want to then link to a full HTML5 Top Nav target. Naturally, the file structure for the 2 targets will be the same, but I want to be able to open the full target so that the source topic populates. Flare only has a system variable for the file name, but is there a Javascript way to replace the middle of a URL with another string, but also be smart enough to know which new string, because I have multiple pop-up/full target pairs?

Example:

Pop-up Topic Path: Output\dmilkes\Pop-up Modal - VL Complete\Content\Administrator\AddCurrency.htm
I want to link that to: Output\dmilkes\HTML5 - VL Complete\Content\Administrator\AddCurrency.htm

But then I will also have Pop-up Topic Path: Output\dmilkes\Pop-up Modal - Non-Admin\Content\Projects\AddProject.htm
I want to link that to: Output\dmilkes\HTML5 - Non-Admin\Content\Projects\AddProject.htm

How can I do this?

Thanks.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Link from topic to corresponding topic in new target

Post by NorthEast »

Try adding this to the end of your master page.

1. Adds a link, a#linkfull
2. Sets topicPath as the current topic href (URL)
3. Tries to match and replace parts of topicPath (the href), checking for each URL variation (if it doesn't match, it doesn't replace)
4. Sets the href of a#linkfull to the topicPath

Code: Select all

        <p><a href="" id="linkfull">Link to full topic</a></p>

        <div>
            <script type="text/javascript">
/*<![CDATA[*/$( document ).ready(function() {	

	var topicPath = window.location.href;
		
	var topicPath = topicPath.replace("Pop-up Modal - VL Complete", "HTML5 - VL Complete");
	
	var topicPath = topicPath.replace("Pop-up Modal - Non-Admin", "HTML5 - Non-Admin");

	$("a#linkfull").attr("href", topicPath);
	
});/*]]>*/</script>
        </div>
Not sure if it'll work for spaces in your path names, you may need to replace each space with %20
DMilkes
Jr. Propeller Head
Posts: 7
Joined: Mon Jun 25, 2018 9:47 am

Re: Link from topic to corresponding topic in new target

Post by DMilkes »

Hi Dave,

This works perfectly (when you get rid of the spaces)! Great workaround for replacing the old WebHelp "Show All" feature, or whatever that was called.

Thanks so much :)
Post Reply