Linking to a web page - possible inside a topic?

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Linking to a web page - possible inside a topic?

Unread post by Dave Gehman »

(This is for a WebHelp project)

I see that I can link a TOC entry, a new topic, to a Web page.

Is it possible to link or otherwise embed a Web page inside a topic?

For each topic that would benefit from this, the external web page would contain some basic but very technical information. The rest of the putative topic would consist of stuff that provides a context for someone who is not a total geek, including graphics, examples, code and the like... in my mind's eye, this friendlier content is flowing seamlessly from the material drawn into the WebHelp via the (hoped-for) in-topic Web link.

If there is no option to embed an external Web page inside a topic: Is there a way to append something like a "More about this topic" button or link at the end of the TOC / Topic that was created via the Insert new Topic or Chapter > TOC Link dialog?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Linking to a web page - possible inside a topic?

Unread post by Tim Green »

Hi Dave,

What you're looking for is the #MERGE directive, which is explained here ("Inserting external HTML files with a code object"):

https://www.helpandmanual.com:/help/hm_ ... _html.html

Note that this does have to be used with care. It will only work in HTML, and it inserts the entire file, which may have side effects on your WebHelp pages, depending on what the page contains. Test carefully before going public with it. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Linking to a web page - possible inside a topic?

Unread post by Dave Gehman »

Tim Green wrote: Wed Feb 26, 2020 7:06 pm Hi Dave,

What you're looking for is the #MERGE directive....
....Test carefully before going public with it. 8)
Believe me, it will be...

As always, thanks!
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Linking to a web page - possible inside a topic?

Unread post by Martin Wynne »

Hi Dave,

An alternative to using #MERGE would be to insert an iFrame in your topic. That's like installing a window opening in your topic page through which you can see an entirely separate web site, with its own heading, scrollbars, formatting, etc. It's very easy to do, just a single line in an HTML Code Object like #MERGE.

Each method has its uses. #MERGE is good where you want to insert info which is frequently updated between Webhelp builds, or where the current info isn't available at the time you are writing the topic. A new MERGE takes place every time you publish a new build.

An iFrame is good where the external web page(s) are created by someone else, or you don't have control of the content. The insertion takes place at the time the user actually looks at the topic.

In #MERGE content, any links it contains will go to your other topic pages in the usual way. In iFrame content, links it contains will be to other web pages which will appear in the iFrame.

cheers,

Martin.
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Linking to a web page - possible inside a topic?

Unread post by Dave Gehman »

Martin, many thanks. Since the links in the iFrame content appear in the topic, I'll definitely experiment with this.
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Linking to a web page - possible inside a topic?

Unread post by Dave Gehman »

Tim Green wrote: Wed Feb 26, 2020 7:06 pm What you're looking for is the #MERGE directive,
This does raise a question for me, who last delved deeply into HTML in 1999, ensuring that I'm remembering almost nothing about it -- in this case, wondering about <html> </html> and whether their loss in the MERGEd document is an issue, and conversely, if their inclusion poses a problem.

The H+M documentation for #MERGE includes steps that mandate the deletion, in the file to be merged into the topic, of everything except the content between the <body> and </body> tags.

Is it OK that these deletions remove (near the very top) <html> and (at bottom) </html> from the file to be merged?

(It doesn't seem to harm things if they are NOT deleted. In an unclean* sandbox example of a topic containing a #MERGE and published as WebHelp, I see via Chrome's "View Source" that the entire contents, of course created both from the H+M skin code and the topic contents, are wrapped in the <html> and </html> tags and that the redundant tags in the MERGEd content seem to do no harm. W3schools doesn't contain any dire warnings about too many <html> </html> tags in a file or about invalid nesting.
_____________________
*unclean meaning that I hadn't deleted content before <body> and after </body>.)
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Linking to a web page - possible inside a topic?

Unread post by Tim Green »

Hi Dave,

Basically, the only way to find out if it's going to work with #MERGE is to give it a try. The range of what could be in a web page is pretty much unlimited, so you really do need to test to be able to know.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Linking to a web page - possible inside a topic?

Unread post by Dave Gehman »

Ok

-keystrokes to get to 20-
Post Reply