Jump to content
TNG Community
Bill Herndon

Soliciting Suggestions for a Bulk Import Mod With Auto-linking

Recommended Posts

Bill Herndon

Recently on the TNG Users list a member asked if there was any way to automatically link media items to TNG records (individuals in this case) using the filename.  He had gotten into a situation where most of his media had become unlinked and he didn't want to have to re-import, and then manually link, all the items again (there were hundreds or thousands).

Having built a personal mod to do this for sources a few years back (I have thousands and most have images or PDFs), I decided to see if there was a way to leverage my mod in a more general way.

There are two problems that my mod solves:

  1. Going back to at least TNG 11 there's a bug (a feature?) in the media import code that prevents TNG from looking for files more than one level down in a media collection.  So if you are importing from the 'documents' folder, a sub-folder 'documents/sources' would be scanned, but 'documents/sources/census' would not.  My mod solves this by replacing the existing code with recursive code that can search the folder structure to an arbitrary depth.
  2. In order to link media with TNG records there needs to be a system to uniquely identify the records.  In my case, each source record in TNG has a unique custom event, a tag that also happens to be the filename for the document that contains the image, PDF, or text of the source.  So the source custom event with a value of 'Holbrook-1805a' links up to a document like 'documents/sources/marriages/Atwood/Polly/Holbrook-1805a.jpg'. 

Fortunately, although TNG doesn't traverse a hierarchy of folders correctly, it has no problem storing and processing media filenames of arbitrary length.  So the real work for such a mod would be to come up with the features that the mod would support.  I can think of a few variants:

  • Link media to individuals using the full name of the individual.  So Herndon, William Robert (me) would correspond to a file HerndonWilliamRobert.[jpg|png|pdf] in one of the media collections.  And since names would have to be unique, incorporation of prefixes and suffixes might be necessary.
  • Link media to families with some similar naming system.
  • Sources using the tagging system (I need to preserve the functionality that I depend on  :- )  )
  • Individuals or families using a tagging system.  This would mostly be for individuals, like me, who have already developed a way of augmenting their individual or family records with a tag that can be used to do the linking.

Are there other items that TNG users would like to link?  Other systems of associating filenames with TNG records that people can think of.  If I can get a decent list of features I should be able to develop and publish this mod pretty quickly.

Thanks,

Bill Herndon

Lindell-Herndon Genealogy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×