* Creating CD

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
normandowns
Gold
Posts: 22
Joined: 26 Apr 2003 00:04
Family Historian: V7

Creating CD

Post by normandowns » 06 Mar 2015 23:38

I have been experimenting with the Create a CD function and have added to the table of contents a few lists of names which have something in common. E.g. I have a list of professional sportsmen which appear in various places in my family tree. Another is a list of clergymen. I have listed these using a stripped-down version of the Individual Summary Report.

What is missing for me is a link to go from someone on this list to that person's "main page". Is there any way to achieve this without resorting to doctoring the HTML after the pages are created?

Regards,
Norman

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Creating CD

Post by tatewise » 07 Mar 2015 14:38

I don't think what you ask for is possible, but here is another idea you might like to try.

This relies on using Individual Custom Id Keywords and the Improve Website or CD DVD HTML Plugin.

On the All tab of the Property Box right-click on the person's name and choose Add Miscellaneous > Add Custom Id.
Enter any Keyword or Keywords that apply, such as Cleric, Sportsman, etc...
Once you have experimented you will soon come up with a workable set of unique Keywords.

After creating the CD, run the Plugin and use the Browse... button at the top to select the CD data subfolder.
On the Index of Names tab tick the Search Filter option, and choose Identity: Custom Id.
Then click the Adjust... button to update the Index.

Now open the CD Index of Names page and in the Search Filter box enter any Keyword and click Start Search to obtain a shortlist of Individuals that match the Keyword and are linked to their pages.

If you like this technique, you may want the Custom Id to appear on the Main tab of the Property Box, so click the cog Menu > Customize Data Entry and add the Custom Id from Available Items on left to Selected Items on right, and click OK.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
normandowns
Gold
Posts: 22
Joined: 26 Apr 2003 00:04
Family Historian: V7

Re: Creating CD

Post by normandowns » 08 Mar 2015 16:36

Thanks Mike. I kind of thought that would be the answer.

Thanks as well for the tip you suggested using the plug-in. I don't think it's really what I'm after though as, if I'm understanding it correctly, it would only really work if the viewer knew what to search for.

What I really want is something to say "Here is something that might interest you."

I think I'll just amend the HTML manually, and keep a backup copy to slot in when the files get refreshed. The lists I'm talking about are unlikely to change much anyway once created.

Regards,
Norman

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Creating CD

Post by tatewise » 08 Mar 2015 18:31

Using the Index of Names approach creates only one _nameindex.html file that needs to be altered to add tips for the user.
The advice above the Search box, and the popup tooltip, are easily edited in the _nameindex.html file to say "Here is something that might interest you. Just search for Cleric or Sportsman to find interesting people".

A tip for keeping any customised files safe, is to create a sub-folder wihin the CD data folder, and keep those files in there, because the Create CD wizard does not delete folders.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Creating CD

Post by tatewise » 10 Mar 2015 11:01

Norman, to convert your stripped-down version of the Individual Summary Report files the attached prototype Plugin should provide the basis for automatically adding hyperlinks.

Its function Main() will probably need slight editing to match your reports exactly.
It relies on each Individual [Record Id] being included with their name.
I assume the names are in Header Level 1 so the Record Text needs [=RecordId()] to be added in the Report Options on the Format tab.

Code: Select all

function Main()
 local strPublic = fhGetContextInfo("CI_PROJECT_PUBLIC_FOLDER")
 local strCDdata = strPublic.."\\FH CD-DVD\\data\\"
 for intFile, strFile in ipairs ({ "toc2", "toc3", "toc4" }) do
  local strPath = strCDdata..strFile..".html"
  local strReport = StrLoadFromFile(strPath)
  strReport = strReport:gsub("(\n<h1 .->)(.- %[(%d+)%])(</h1>\n)","%1<a href='ind%3.html'>%2</a>%4")
  SaveStringToFile(strReport,strPath)
 end
end
The 3rd line assumes your files are all in the default ...\Public\FH CD-DVD\data folder.
The 4th line assumes your reports are named toc2, toc3, toc4.
The 7th line uses LUA Patterns to add the hyperlink and may need adjusting depending on your report HTML format.
Post a snippet of your Individual names from any HTML report and I will advise what LUA pattern is needed.
Last edited by tatewise on 11 May 2023 14:28, edited 2 times in total.
Reason: Attachment Add Report Hyperlinks.fh_lua deleted ~ ask Mike Tate (tatewise) if you need a copy
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply