Jump to content
TNG Community
Nate Jacobs

Introducing Family Roots - Seamless WordPress & TNG Integration

Recommended Posts

Nate Jacobs

Introducing Family Roots - Seamless WordPress & TNG Integration

Family Roots is a new WordPress plugin designed to seamlessly integrate WordPress and The Next Generation of Genealogy Sitebuilding (TNG). Family Roots uses native WordPress database functions to connect to and pull data from the TNG database. Family Roots offers simple and clean default templates or create your own to display your genealogy research. The plugin is a fast and safe way to show off your family tree.

Some problems with the current WordPress and TNG integrations.

1. Require modifications of core TNG or WordPress files

2. Create invalid HTML markup

3. Use insecure PHP eval function

4. Slow to load TNG files

5. Required to use specific WordPress themes

6. Difficult to configure and get running correctly

Family Roots is plug-and-play ready. Simply activate the plugin and ensure the file path to your TNG install is correct (the plugin will try and find it during activation or you can set it on the Family Roots settings page under the Settings menu.). In no time you'll be viewing your family tree with default templates that fit with any WordPress themes you want to use. There are no modifications required to any TNG or WordPress core files. I created the plugin as I was unhappy with how slow the existing TNG and WordPress integrations were. I also wanted to be able to use any theme I wanted. It may not be for everyone, but it is exactly what I was looking for. Please let me know if you have any suggestions for improvements.

Features

Use any WordPress Theme

The plugin comes with several templates used to display data about a person, family or place. You can design your own templates and include them in your theme folder to use those instead of the default ones. The plugin uses a common base URL structure of yoursite.com/genealogy/xxxx for the pages.

Integrated Search

The plugin integrates the default WordPress search with a person search from TNG. your site visitors can search for all the content on the site that contains the word 'john*'. Not only will your posts and pages be returned, but anyone with the first or last name in TNG that starts with John.

Relationship Search

Family Roots allows you to determine the blood relationship between anyone in your family tree and display the results in your WordPress.

Widgets

The plugin includes two widgets you can add to your sidebar or any widgetized area. The two widgets are a listing of all birthdays for the current day and a list of deaths for the current day.

Shortcodes

Add brief details about a person or family from TNG into your WordPress post or page. [family_roots_person id=#]

Query Family and People

The plugin has two classes, based upon WP_Query and WP_User_Query, that allow you to search for people or families using different fragments of data and display the results in your site. You can learn more about how to use the two classes here.

Requirements

You can read more here

Technical

* PHP 5.5 or greater

* WordPress 4.0 or greater

TNG

* Single tree

* No branches

Example Sites

* Family Roots Demo - this site uses the Twenty-Thirteen theme and the default plugin settings.

* Jacobs Family Genealogy - this site is my personal genealogy site that uses custom templates to display person information from TNG using a theme based off Bootstrap. The site is in its infancy so it is rather basic at this time, but will give a good idea of how the templates can be customized to fit what you want. I have restricted the viewing of most details of living people to logged in users. This is an example of the full view of data for deceased individuals and logged in users.

Where to Get It

You can download the plugin from my Github page. You can view the custom templates used in my family genealogy site here.

Roadmap

* Add class to associate sources with people

* Add class to display cemetery information

* Integrate family search by name into the default WordPress search

Share this post


Link to post
Share on other sites
Martin J Mosley

Thank you Nate!!

This looks like it has the potential I for one have been looking for.

Is it possible to format tng data display through the wp theme, so that events, images, maps etc can be placed according to specific site preferences? I note both your sites have the same tng layout, and wonder how easy it is to adapt this..

Can the standard tng charts still be used?

This looks like a big step forward for those of us using wp and I'll be interested to hear a little more before taking the plunge.

Edit: The Github page link goes to a blank page.

Share this post


Link to post
Share on other sites
Nate Jacobs

Is it possible to format tng data display through the wp theme, so that events, images, maps etc can be placed according to specific site preferences? I note both your sites have the same tng layout, and wonder how easy it is to adapt this..

Yes, that is the whole point of this plugin. With a little bit of HTML, PHP and CSS you can create custom templates that place the TNG data in your WordPress theme where you want. The only thing TNG is being used for is the database. The theme used in TNG has no bearing on how the data is displayed in WordPress.

Can the standard tng charts still be used?

At this time no. I have not rebuilt all the charts from TNG into the plugin. The only one so far is a simple ancestor chart that goes back three generations.

Edit: The Github page link goes to a blank page.

Good catch. There was a misplaced opening quote. It has been fixed.

Share this post


Link to post
Share on other sites
klooster

Hi Nate,

First of all my compliments for the work you have done.

Secondly I would like to say that for me personally it is absolutely no contest who designs the best method of integrating TNG with Wordpress and I think it is great that so many people try to make WP_TNG better.

I will go with any method of integrating TNG with Wordpress that comes to the top, mine or someone else.

Your integration with WP seems to work fine, but:

  • Why make plugin that uses TNG just for the database information and losing most of the TNG functions for layout, charts etc. TNG by itself does a lot more more then just pulling information out of the database.

    You lose a lot of the beautiful layout of TNG.

    For instance the places are not displayed by first letter as in TNG but as a long alphabetical vertical order. I have to many places for that.

    Not all the beautiful TNG charts are available.

    Support no branches

    No support for multiple trees

  • So it looks to me that with integrating TNG with Wordpress this way, you lose a lot of the functionality of TNG itself.

Share this post


Link to post
Share on other sites
mahesh

Very nice Nate.

Although similar to my TNG Plugin, it's different and that is good.

We created our plugin, about a year ago, and it is really there to cater for my own needs.

I think it is about time users had more choice in how the TNG data is used / displayed.

Nate, your superior knowledge of wordpress and TNG is quite apparent.

Share this post


Link to post
Share on other sites
Nate Jacobs

Your integration with WP seems to work fine, but:

  • Why make plugin that uses TNG just for the database information and losing most of the TNG functions for layout, charts etc. TNG by itself does a lot more more then just pulling information out of the database.

    You lose a lot of the beautiful layout of TNG.

    For instance the places are not displayed by first letter as in TNG but as a long alphabetical vertical order. I have to many places for that.

    Not all the beautiful TNG charts are available.

    Support no branches

    No support for multiple trees

  • So it looks to me that with integrating TNG with Wordpress this way, you lose a lot of the functionality of TNG itself.

You are quite correct. For me personally, I am only using TNG at this point for the gedcom file parsing to MySQL (only because I don't feel like writing my own, TNG does it well). I don't think the included default TNG templates are very good looking. The overall design of the application causes it to be slower for a multitude of reasons.

One of the great things about Family Roots is if you don't like how the locations are presented, then you can change the template to render that page. You can easily order them by first letter (I don't like how I currently display them either, I am working on a better default template). The full control is in your hands. I don't use branches or other trees so those two things were not of importance to support initially. The lack of the full depth of charts is definitely missing from Family Roots. The charting aspect is what I am working on for the next release.

The plugin was created to satisfy my needs. I just thought I would share it in case others had similar needs. The beauty of it all, as you stated, is to find the method of integration that works best for you and go with it.

Share this post


Link to post
Share on other sites
Nate Jacobs

I think it is about time users had more choice in how the TNG data is used / displayed.

Nate, your superior knowledge of wordpress and TNG is quite apparent.

I agree! Thank you.

Share this post


Link to post
Share on other sites
PJGerritsen

Trying to activate the plugin, I get the following error:

Fatal error: Can't use method return value in write context in /home/id787496/domains/famintzandt.nl/public_html/wpsite/wp-content/plugins/Family-Roots-1.1/inc/class-utilities.php on line 491

Any idea what can be the cause, and how to resolve it?

TNG 10.0.3 & WP 4.0.1

Share this post


Link to post
Share on other sites
Nate Jacobs

That most likely indicates your version of PHP is not compatible. The plugin requires PHP 5.5.

Trying to activate the plugin, I get the following error:

Fatal error: Can't use method return value in write context in /home/id787496/domains/famintzandt.nl/public_html/wpsite/wp-content/plugins/Family-Roots-1.1/inc/class-utilities.php on line 491

Any idea what can be the cause, and how to resolve it?

TNG 10.0.3 & WP 4.0.1

Share this post


Link to post
Share on other sites
Martin J Mosley

Trying to activate the plugin, I get the following error:

Fatal error: Can't use method return value in write context in /home/id787496/domains/famintzandt.nl/public_html/wpsite/wp-content/plugins/Family-Roots-1.1/inc/class-utilities.php on line 491

Any idea what can be the cause, and how to resolve it?

I have the same problem, and it is the php version.

I regret because this is a great step forward for those of us using tng with wp.

Share this post


Link to post
Share on other sites
Nate Jacobs

I am working on bringing the version required down to PHP 5.4. I hope to have that done by the 1st of January.

Share this post


Link to post
Share on other sites
Hinson

I know this may sound like a dumb question for you tech savvy folks, but how do you install this plug-in. I downloaded and and unzipped the family-roots folder but do not know where to go from there.

Share this post


Link to post
Share on other sites
MartinW

Hello Nate,

thanks for your great work - this plugin seems very promising.

I really would like to see support for more than one tree and branch here, though.

Who would second that? :)

Thanks again,

Martin

Share this post


Link to post
Share on other sites
Nate Jacobs

I know this may sound like a dumb question for you tech savvy folks, but how do you install this plug-in. I downloaded and and unzipped the family-roots folder but do not know where to go from there.

Take the unzipped folder and place it into your wp-content/plugins folder. Then activate the plugin from the WordPress dashboard.

Share this post


Link to post
Share on other sites
Nate Jacobs

Hello Nate,

thanks for your great work - this plugin seems very promising.

I really would like to see support for more than one tree and branch here, though.

Who would second that? :)

Thanks again,

Martin

I am definitely looking at figuring out how to add support for more than one branch and tree.

Share this post


Link to post
Share on other sites
Hinson

Take the unzipped folder and place it into your wp-content/plugins folder. Then activate the plugin from the WordPress dashboard.

Nate; thanks a bunch. I should have known that but for some reason, I was thinking it had to go in the TNG folder somewhere.

Thanks again.

Share this post


Link to post
Share on other sites
Kjell Arne Brudvik

Hi,

I figured I’d test your WP/TNG integration but I cannot even get it installed. I run Wordpress version 4.1 and PHP is running version 5.5.5.


Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/home/brudvik/domains/brudvik.org/public_html/wp-content/uploads/wpcf7_uploads): failed to open dir: Permission denied' in /home/brudvik/domains/brudvik.org/public_html/family/wp-content/plugins/family-roots/inc/class-utilities.php:51 Stack trace: #0 [internal function]: RecursiveDirectoryIterator->__construct('/home/brudvik/d...', 4096) #1 /home/brudvik/domains/brudvik.org/public_html/family/wp-content/plugins/family-roots/inc/class-utilities.php(51): RecursiveDirectoryIterator->getChildren() #2 /home/brudvik/domains/brudvik.org/public_html/family/wp-content/plugins/family-roots/family-roots.php(120): FamilyRootsUtilities->get_path() #3 [internal function]: FamilyRootsLoad->activation('') #4 /home/brudvik/domains/brudvik.org/public_html/family/wp-includes/plugin.php(496): call_user_func_array(Array, Array) #5 /home/brudvik/domains/brudvik.org/public_html/family/wp-admin/plugins.php(155): do_action('activate_fa in /home/brudvik/domains/brudvik.org/public_html/family/wp-content/plugins/family-roots/inc/class-utilities.php on line 51

Share this post


Link to post
Share on other sites
Kjell Arne Brudvik

Didn't realize untill I posted, my solution runs in the ROOT, BUT - not the web root, as it's a sub-domain. It tries to reach a folder outside where it's actually installed. /home/brudvik/domains/brudvik.org/public_html/wp-content/ should have been /home/brudvik/domains/brudvik.org/public_html/family/wp-content/.

Share this post


Link to post
Share on other sites
Kjell Arne Brudvik

For others, I just did this little change in order to get it installed:


FILENAME: inc/class-utilities.php
    public function get_path() {
        // get the directory above the WordPress install
        $path = dirname(ABSPATH . "/family"); // added . "/family

Share this post


Link to post
Share on other sites
Nate Jacobs

Thanks for finding that. I need to do a better job catching the error so I don't trigger the fatal error and stop installation.

Share this post


Link to post
Share on other sites
mc1974

Hi,

I have uploaded the plugin (PHP 5.5.9, TNG 10.1, WP 4.1.1).

But when I try to activate ... it does nothing and jumps to the following menu item in my Dashboard. No error message or something else.

Can somebody help this non technician?

Regards,

Morten

UPDATE: solved. using the solution from Kjell.

Share this post


Link to post
Share on other sites
bitterer

Hi,

I am just moving my old family tree data to a fresh tng/wp site with ssl support. Both installations are working fine standalone, even with the ssl forward due to htaccess configs.

Then I found this add-on (Thanks Nate!)  - but even with Kjells config modification i get a 404 in wp.

And I can't edit the TNG Config Values for the TNG URL, there is only "photos" accepted as in the Photo Directory. If I enter the correct url a "save changes" resets it to "photos. [Edit: Found it, is copied from tng settings.]

Any ideas?

(WP 4.3 / Suffision & TNG 10.1.2)

Regards, Martin
 

Edited by bitterer

Share this post


Link to post
Share on other sites
bitterer

The integrated search is working. But all responses are linked to a page /archive/-1

Regards, Martin

Edited by bitterer

Share this post


Link to post
Share on other sites
Haime Croeze

Hi, this is just the solution I am looking for!!, from database rather then tng templates... I have not been able to install the plugin though, running php 5.6 (can't downgrade either) and trying to test it on test3.croeze.net. Even Kjell's addition does not do the trick. Every time I try to activate the plugin I get a blank page, setting wp-debug in config to true does not show reason either. Any pointers?

regards,

Haime Croeze

www.croeze.net

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

×