Jump to content
TNG Community
bryanlewis

Custom Page Title and Descriptions

Recommended Posts

bryanlewis

I am trying to figure out how to customize the page title (<title> tag) for the Person and Family pages, as well as set a custom meta description (<meta name="Description">).  Currently, TNG sets these two things to the same value and for SEO purposes, I would like to adjust them.  I have searched through the codebase a bit and searched the forum, but I cannot figure out where these values are being set.  Any pointers would be appreciated.

Thanks,

Bryan

Share this post


Link to post
Share on other sites
bryanlewis

I found where the page title and description were being set -- in the tng_header() method in genlib.php. Unfortunately, they are hardcoded to be the same value (the $title variable passed into tng_header).  So there is no simple way to make the meta description different.  :(

Share this post


Link to post
Share on other sites
Ken Roy

$title is a variable you pass when calling the tng_header function.   On Custom pages, your should be in control of the title.  On the getperson.php page, TNG sets the title to the person's name, birth and death dates of the person being display.  It does something similar with the Family page display.

The <title> is different on every getperson.php and familychart.php or familygroup.php page.

Share this post


Link to post
Share on other sites
bryanlewis

Yes, I figured that part out Ken.  Thanks.  I did do some custom adjustments to the title.  But the meta description is also going to be whatever the title is set to. 

Google's SEO isn't a big fan of having the title and description being set to the exact same thing, and it looks odd in the search results to have the information duplicate.  That's why I was trying to set them to different strings.

Bryan

Share this post


Link to post
Share on other sites
Ken Roy

You could take a look at the Simple SEO mod.  Personally, I was never concerned about any SEO since the rules are forever changing.

Share this post


Link to post
Share on other sites
bryanlewis

Thanks again for the recommendation.  I tweaked things myself manually to get what I wanted.  Now I just need to create a private mod out of it so I don't forget when the next update hits.

Bryan

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

×