Jump to content
TNG Community
zanger02

Template 18 - links on home page

Recommended Posts

zanger02

I'd like to add more links to the right of the existing links on the home page. No matter what I try the extra links don't show or they are duplicates of the first two. TNG v12.1 and template 18. Not sure what I'm missing. I'm a developer but I'm really new to PHP.

Before changes

<?php
include($cms['tngpath'] . "surname_cloud.class.php");
$flags['noicons'] = true;
$flags['noheader'] = true;
$flags['nobody'] = true;
$tngconfig['showshare'] = false;
tng_header( $sitename ? "" : $text['ourhist'], $flags );
if(!$cms['support'] && $sitever != "mobile")
	echo "<body id=\"bodytop\" class=\"" . pathinfo(basename($_SERVER['SCRIPT_NAME']), PATHINFO_FILENAME) . " homebody\">\n";

$dadlabel = getTemplateMessage('t18_dadside');
$momlabel = getTemplateMessage('t18_momside');
?>

<div class="theader">
	<div id="thomemast" class="mast">
		<h1><?php echo getTemplateMessage('t18_maintitle'); ?></h1>
			<span class="tsubtitle"><?php echo getTemplateMessage('t18_headsubtitle'); ?></span> 
	</div>
	<div id="tmenu">
	  <ul>
<?php
	if($dadlabel) {
?>
	<li><a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t18_dadperson']; ?>&tree=<?php echo $tmp['t18_dadtree']; ?>"><?php echo $dadlabel; ?></a></li>
<?php		
	}
	if($momlabel) {
?>
	<li><a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t18_momperson']; ?>&tree=<?php echo $tmp['t18_momtree']; ?>"><?php echo $momlabel; ?></a></li>
	
<?php		
	}
	echo showLinks($tmp['t18_featurelinks'],false);
?>
	</ul>
  </div>
</div>

I tried adding two more links

............
$dadlabel = getTemplateMessage('t18_dadside');
$momlabel = getTemplateMessage('t18_momside');
$stepdadlabel = getTemplateMessage('t18_stepdadside');
$stepmomlabel = getTemplateMessage('t18_stepmomside');
............

<?php
	if($dadlabel) {
?>
			<li><a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t18_dadperson']; ?>&tree=<?php echo $tmp['t18_dadtree']; ?>"><?php echo $dadlabel; ?></a></li>
<?php		
	}
	if($momlabel) {
?>
			<li><a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t18_momperson']; ?>&tree=<?php echo $tmp['t18_momtree']; ?>"><?php echo $momlabel; ?></a></li>
<?php		
	}
	if($stepdadlabel) {
?>
			<li><a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t18_stepdadperson']; ?>&tree=<?php echo $tmp['t18_stepdadtree']; ?>"><?php echo $stepdadlabel; ?></a></li>
<?php		
	}
	if($stepmomlabel) {
?>
			<li><a href="<?php echo $cms['tngpath']; ?>pedigree.php?personID=<?php echo $tmp['t18_stepmomperson']; ?>&tree=<?php echo $tmp['t18_stepmomtree']; ?>"><?php echo $stepmomlabel; ?></a></li>
	
			<?php		
	}
	echo showLinks($tmp['t18_featurelinks'],false);
?>

 

 

Screen Shot 2020-04-04 at 1.03.57 PM.png

Share this post


Link to post
Share on other sites
Ken Roy

I think you are over complicating the process.  Just go to TNG Admin > Setup > Template Settings and in the Feature links section add the links you want to add

For example

TNG Wiki, https://tng.lythgoes.net/wiki/index.php, ext

Note that the ext 3rd parameter is only valid in TNG 12.3 to open the link in a separate tab

Share this post


Link to post
Share on other sites
zanger02

Thanks!

First thing I tried was the template settings. There's no option to add a link to the two links. The feature links are further down the page and already used.

Share this post


Link to post
Share on other sites
Ken Roy

Maybe I was too cryptc in my reply.  You can add as many links as you want in that textarea

Third Link, http://tngsitebuilding.com
Fourth Link, http://tngsitebuilding.com/blog
Link name, absolute URL
Link name, another URL

You can also change the Third and Fourth link to whatever you like

Share this post


Link to post
Share on other sites
zanger02

You were cryptic. 😀 Lol!!!  I didn't realize I could add links in the text box. 🤣 Thanks!!

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

×