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.
Link from topic to corresponding topic in new target
Re: Link from topic to corresponding topic in new target
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
Not sure if it'll work for spaces in your path names, you may need to replace each space with %20
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>
Re: Link from topic to corresponding topic in new target
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
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