Page 1 of 1

Family Historian 7 and TNG 12.1

Posted: 10 Apr 2023 12:58
by Sharon
I have been using FH as my main database for my family research for years and I am now trying trying to tidy up the notes and various media files, with a view to updating my TNG website mainly with updated histories of some of my ancestors.

I tend to create these 'histories' - mini life stories - in MS Word, export them as PDF files and then import them into FH, which works well enough. In the past I have just added these PDF files to TNG, but the last time I did updates, I decided to create PHP files so that the histories were displayed as web pages, to make the website more interesting to look at. The downside of this though is that I now have 2 copies of each history, doubling the work needed when they are updated.

Is there a way of converting MS Word or PDF documents into PHP, or vice versa, so that pictures and formatting come through in an intelligibe way? (The export as single file webpage (mht) does not work well). Or how have others worked around this problem if they have come across it? I'm just trying to save time and keep copoes in sync if at all possible.

Thank you. :)

Re: Family Historian 7 and TNG 12.1

Posted: 10 Apr 2023 13:31
by Valkrider
Don't forget one of the save options in Word is 'Save as a web page' could you use that. From memory it creates an html file which you can embed in a php page.

Re: Family Historian 7 and TNG 12.1

Posted: 10 Apr 2023 14:37
by Sharon
The 'save as a webpage' option doesn't work very well for me. It messes about with the formatting, moves the pictures and seems to overwrite some lines twice. I've added a snapshot (I hope) of part of the page to explain what I mean.

I didn't know it could be embedded as html for inclusion in a php file though. It actually creates an mht file, would this work in the same way? And how do I access the html?

webpage export.JPG
webpage export.JPG (185.03 KiB) Viewed 513 times
Thank you: )

Re: Family Historian 7 and TNG 12.1

Posted: 10 Apr 2023 14:41
by Sharon
The 'save as a webpage' option doesn't work very well for me. It messes about with the formatting, moves the pictures and their captions and seems to overwrite some lines twice. I've added a snapshot (I hope) of part of the page to explain what I mean.

I didn't know it could be embedded as html for inclusion in a php file though. It actually creates an mht file, would this work in the same way? And how do I access the html?


Image

Thank you: )

Re: Family Historian 7 and TNG 12.1

Posted: 10 Apr 2023 14:43
by Valkrider
It isn't something that I have done but I have just checked and I can save as an htm file see below instead of the save as web page.
html save.png
html save.png (105.62 KiB) Viewed 509 times

Re: Family Historian 7 and TNG 12.1

Posted: 10 Apr 2023 14:46
by ADC65
Hi Sharon, have you read the advice on creating Histories pages on TNG on the TNG Wiki? There are a number of different ways, including creating them from media files (including Word, PDF, etc.)

A brief description is given here, if you haven't already seen it: https://tng.lythgoes.net/wiki/index.php ... -_Creating

There are also a lot of people in the TNG Forum that create history pages, so you could try asking there. The level of help can vary. The link is https://tng.community/index.php?/forums/

I don't make extensive use of Histories myself in TNG, and I can't think of an efficient way of automatically copying them across from FH files, but there are people in the TNG Forum much more experienced that might be able to help.

Re: Family Historian 7 and TNG 12.1

Posted: 10 Apr 2023 15:00
by Sharon
Thank uou both - I'll look into your suggestions. :) :)

Re: Family Historian 7 and TNG 12.1

Posted: 11 Apr 2023 07:04
by Sharon
I've looked into both your suggestions now and realised I tried both when I was first learning to create the php pages.

Converting Word to html creates a lot of its own html code which is useless for creating php pages and very confusing when it comes to editing them. I had to learn to use TNG's historytemplate.php using the Creating Histories pages of the TNG Wiki. What I am hoping to do now is to be able to update these pages without havng to re-create them from scratch.

I think you are right though, I need to ask the TNG forum if anyone has found a simple way to do this.

Thank you both for your help. :)

Re: Family Historian 7 and TNG 12.1

Posted: 11 Apr 2023 13:22
by harold
One option I have done in the past with some success was, copy and paste directly from a formatted (Word) document into the Body Text field of a media object in TNG. The Body Text field is a fairly powerful editing tool which will maintain most of the original formatting of the pasted document. It even allows you to switch between HTML mode and VIEWER mode for easy fine tuning. (It worked very well, at least from Word. I did not have great results copying from PDF documents.). Embedded photos or other objects get pasted. They are replaced in the pasted document with placeholders and need to be handled manually. It is not PHP but the displayed results are similar.

To do this I selected the Add New tab option in the Admin Media window of TNG. Then paste directly into the Body Text field.

After pasting and editing, give the new media object a Title/Description and Save. You can link and view this object in exactly the same ways you would with any media object containing a digitized image and the results are displayed in a standard TNG page. I found it surprisingly useful when I needed it.