Relative Hyperlinks in WebHelp

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
raikeswood
Propeller Head
Posts: 30
Joined: Tue Feb 05, 2008 9:29 am
Location: Harrogate, North Yorkshire, UK

Relative Hyperlinks in WebHelp

Post by raikeswood »

I hope someone may be able to help me? I'm creating a WebHelp system that will be hosted on a partner's servers and will contain links back to their help topics. I cannot (or should not) use absolute hyperlinks as the server that a user is logged into will change depending on location and other factors.

However, when I try to specify a relative hyperlink to the external topic like this:

Code: Select all

<a href ="/help/doc/user_ed.jsp?section=help&loc=help&target=adding_fields.htm">Link Text</a>
(relative to the root)
the build process changes the link in the output to:

Code: Select all

<a href ="../../help/doc/user_ed.jsp?section=help&loc=help&target=adding_fields.htm">Link Text</a>
(relative to the current location).

I need the output to retain the original URL (relative to the root).

Any advice would be appreciated. Thanks.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Relative Hyperlinks in WebHelp

Post by LTinker68 »

raikeswood wrote:

Code: Select all

<a href ="/help/doc/user_ed.jsp?section=help&loc=help&target=adding_fields.htm">Link Text</a>

That path indicates that your current topic is one level down from your default.htm page (which is generated automatically) and that the partner's "help" folder is stored at the same root level as your deafult.htm page. Is that really the case? Or is it that your help output is in one folder which is at the same root level as the partner's "help" folder? If that's the case, then the path below is correct, because it has to go up two levels to get to the partner's "help" folder.
raikeswood wrote:

Code: Select all

<a href ="../../help/doc/user_ed.jsp?section=help&loc=help&target=adding_fields.htm">Link Text</a>
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Relative Hyperlinks in WebHelp

Post by doc_guy »

I believe the OP wants to go to the root of the deployed system go get to a different page, as opposed to going to a topic in the Flare help system, so I trust that the path given is correct. I think Flare is changing this, because when you create relative links Flare expects you to be linking to something in Flare. Absolute links would prevent Flare from mucking with the path, but I understand that you don't want absolute links, so I'm stumped.
Paul Pehrson
My Blog

Image
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Relative Hyperlinks in WebHelp

Post by LTinker68 »

You could create a dummy folder in your project with a placeholder topic and give that topic the same name as the final destination topic. Flare will use the relative path to that placeholder topic. When you build the output, just delete that folder. The link will still stay there, so as long as you put the placeholder topic in the appropriate relative position and gave it the correct name, then it should work.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Relative Hyperlinks in WebHelp

Post by NorthEast »

Yep, raikeswood said the link is relative to the root, so the leading / in the URL is correct.

I tested this out and although it works fine with htm files, but it doesn't work with js/jsp files.

In my topic, I had the following links:

Code: Select all

<p><a href="/test/test.htm">link to a htm file</a></p>
<p><a href="/test/test.jsp">link to a javascript file</a></p>
These link to test files in the c:\test folder - test.htm and test.jsp.

When I compile the help, the link to the htm file works fine but the link to the jsp file doesn't work.

Looking at the links in the output topic, I see:

Code: Select all

<p><a href="/test/test.htm">link to a htm file</a></p>
<p><a href="../test/test.jsp">link to a javascript file</a></p>
So there's the problem, Flare seems to change links to js/jsp files and adds .. to the start of the link (../test/test.jsp). Or in raikeswood's case, it's adding ../..
raikeswood
Propeller Head
Posts: 30
Joined: Tue Feb 05, 2008 9:29 am
Location: Harrogate, North Yorkshire, UK

Re: Relative Hyperlinks in WebHelp

Post by raikeswood »

Thanks for all your help. Really appreciate your advice. It seems it's a problem Flare has handling relative links to javascript files. Don't really know what to do next? Is there anyone from Madcap that can contribute? Thanks again.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Relative Hyperlinks in WebHelp

Post by NorthEast »

Report it here:
https://www.madcapsoftware.com/bugs/submit.aspx

Have you tried wrapping up the link in javascript? e.g. does this work for js/jsp links:

<a href="#" onclick="javascript:window.open(' link');">
raikeswood
Propeller Head
Posts: 30
Joined: Tue Feb 05, 2008 9:29 am
Location: Harrogate, North Yorkshire, UK

Re: Relative Hyperlinks in WebHelp

Post by raikeswood »

OK, Dave I will. Thanks for your help. I'll try your idea too.
Post Reply