Link to CHM with subfolder

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

Moderators: Alexander Halser, Tim Green

Post Reply
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Link to CHM with subfolder

Unread post by John Johann »

I have legacy modular CHMs with subfolders.
I imported the master CHM with the TOC
It contains external links Linkname --> Projector help file = Linkname.chm --> Topic ID of external help file=Subfolder.pagename

Those links don't work --> the period is converted to an underscore so the file isn't found.

What do I need to do?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to CHM with subfolder

Unread post by Tim Green »

If you don't have the HM projects from which the CHMs were created (which you won't if they weren't created with HM, of course...) you'll need to do some multi-file search and replace on the topic files. For this make sure that your projects are saved in the uncompressed HMXP format, for which you will need a separate folder for each project. Select Save As... in the File menu to save in the uncompressed format if you are using HMXZ. (Generally, you should always use uncompressed for larger projects and ongoing work.)

Then locate one of the links you are going to need to change, select the XML editor tab next to the main editor window, locate the XML of the link there and make a copy of it. Then change the link in Help+Manual so that it points where you want and get the changed XML for that. That is then a model for what you are going to need to search and replace in the XML topic files. You can use any tool that will do search and replace in multiple files for this, for example the free Notepad++ editor (which everyone should have) or a more powerful tool like PowerGREP or WinGREP.
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.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Link to CHM with subfolder

Unread post by John Johann »

Hi Tim,
Thanks -- however, the projects are not H&M projects -- I only have the CHMs which I have not imported into H&M (also not an option as they need to be reworked and importing would create flat CHM output).

For a transition period, I have to support the old CHMs with the sub-folders.

There is no interim version of the old CHMs without sub-folders.

Therefore, I need to retain the references to the sub-folders in the master TOC.

When I import the existing master TOC into H&M, the links to external files are changed: Projector help file = Linkname.chm --> Topic ID of external help file=Subfolder.pagename

When I manually replace the period with a slash, it gets removed when I publish the TOC.

I need to be able to keep the correct path with the slash.

Is changing the link to a Weblink the way to go? mk:@MSITStore:Linkname.chm::/Subfolder/pagename.htm
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to CHM with subfolder

Unread post by Tim Green »

Hi John,

I'm afraid HM doesn't support CHMs with internal sub-folders. It always creates a flat file structure inside the CHM and can't create anything else. So if you need to go on supporting those you won't be able to create them from a HM project, because it always creates its own flat file structure. :?
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.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Link to CHM with subfolder

Unread post by John Johann »

Hi Tim,
I appreciate what you're saying. But just to be clear, I do not want to create CHM files with sub-folders -- just link to ones that already exist. The master TOC does not contain any folders. Only the legacy CHM files have sub-folders.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to CHM with subfolder

Unread post by Tim Green »

Hi John,

Ah, when you said you were importing them it sounded as though you wanted to convert them to HM projects and keep their multi-level structure. You can link to an existing CHM like that without problems. You just need to select the CHM directly in the Help File: field in the Link tool. Then Help+Manual will look inside the file and show you the topics, which you can then select directly:
multilevel_chm.gif
Note that this will only work if the CHMs are all in the same folder when they are distributed. Also, since these CHMs already exist, the master file with the main TOC should have exactly the same name that they are expecting to see, otherwise it won't work (since you can't change that inside the existing CHMs).

In some cases you may also need to manually create a [MERGE FILES] setting in your master project:
  1. In the Project Explorer, navigate down to Configuration > Publishing Options > Microsoft HTML Help > Extended .HHP Settings
  2. In the editor box on the right, enter [MERGE FILES] on the first line.
  3. After that, enter the name of each child CHM file on a single line below that. The file names must not contain any spaces, accented characters or non-alphanumeric characters. No blank lines.
You do not have the required permissions to view the files attached to this post.
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.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Link to CHM with subfolder

Unread post by John Johann »

Hi Tim,

Now we're almost on the same page.

The master file and the modules have the same names as before.

The Insert Hyperlink screenshot is what I see when I try to insert a link on a page -- and you're right -- it works with the sub-folders when the link is on the page.

I do not have any pages in the master TOC (ok just intro) but the rest are TOC links directly from the TOC to the target CHMs.

The link from the Master TOC is in the Project Explorer (i.e. not from a page -- but directly from the TOC).

I do not have the Topic Link option in the TOC "Insert new Topic or Chapter" menu -- I have New Topic/Chapter (but cannot select a different CHM at Topic ID), Multiple Topics, TOC Link, Link to External Help and Include Help Project.

None of those allow me to link to the target page in the sub-folder of the old CHM.
User avatar
julio
Posts: 118
Joined: Wed May 28, 2008 12:06 am
Location: Porto Alegre, RS - Brasil
Contact:

Re: Link to CHM with subfolder

Unread post by julio »

The correct way to create a link to a CHM file with or without sub-folders is this:
  1. Select the Link option on the Insert group of the Write Ribbon.
  2. Select the File Link tab.
  3. Type "hh.exe" (without quotes) in the File name field.
  4. Type "ms-its:filename.chm::/topicfile.htm" or "ms-its:filename.chm::/subfolder/topicfile.htm" (without quotes).
John Johann wrote: Is changing the link to a Weblink the way to go? mk:@MSITStore:Linkname.chm::/Subfolder/pagename.htm
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Link to CHM with subfolder

Unread post by Tim Green »

John,

See Julio's instructions for creating links manually (I was going to add that next).
The link from the Master TOC is in the Project Explorer (i.e. not from a page -- but directly from the TOC).
Don't do this with runtime modules. That is self-defeating and bad practice. You can insert the CHM file directly as a module. Just select a CHM instead of a HM project. However, don't try to include topics from runtime modules directly in the TOC of the master.

Also, a master TOC must always have at least one topic of its own.
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.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Link to CHM with subfolder

Unread post by John Johann »

Hi julio, Tim,

Thank you both.

My mistake was to want to link to a page in the child CHM from the TOC.

Tim's tip: Insert new Topic or Chapter > Include Help Project > Project File =some.chm did the trick
Post Reply