Template Settings - Template2

From TNG_Wiki
Jump to navigation Jump to search

Settings

The following illustrates how you can use the new TNG V8 Template Settings to change the photos for Template 2. Also included are instructions that were extracted from the index.php and topmenu.php for Template 2 on how to use text instead of images for the page heading.

TNG V8 Template Settings allows you:
  • to change what images will be used
  • to specify the starting person ID and treeID for:
    • the Pedigree Chart
    • the Photos and History (extratrees.php)

for Template 2

Template 2 settings

Images

If you create your own images, you should use the same dimensions as used by Template 2 as shown below for the default images provided.

Template 2 home page header

  • file name is homeheader.gif
  • dimensions are 443 x 114 pixels
  • used in line 41 of index.php

Template 2 home page photo

  • file name is mainphoto.jpg
  • dimensions are 327 x 460 pixels
  • used in line 146 of index.php

Home Page Title

The Home Page title is generated by the $text['ourpages'] variable passed on the tng_header function call.

tng_header( $text['ourpages'], $flags );

To change it copy it variable from the languages/English/text.php or languages/English-UTF8/text.php file

$text['ourpages'] = "Our Family Genealogy Pages";

paste it in your languages/English/cust_text.php (or languages/English-UTF8/cust_text.php) file and modify it to reflect your Home Page title, for example

$text['ourpages'] = "Martin Family Genealogy Pages";

Optional Text Title

index.php

Optionally, you can comment out line 47 of template 2 index.php (Note that the code was wrapped for display purposes below)

	<!-- 	<img src="<?php echo $cms['tngpath']; ?><?php echo $tmp['t2_titleimage']; ?>" alt="" 
width="443" height="114" class="noimgborder" /> --> 

and remove the start comments ( <!-- ) on line 55 and end comments ( --> ) on line 63, and change the Our Family<br />Genealogy Pages on line 59 to your own personal text rather than creating a text image.

This option also allows you to use the $text['ourpages'] variable by changing line 50 to use <?php echo "$text['ourpages'] \n"; ?> which will echo the $text variable from your language text.php files so your home page title changes with a dynamic language switch.

The English/text.php has

$text['ourpages'] = "Our Family Genealogy Pages";

and the French/text.php

$text['ourpages'] = "La généalogie de notre famille";

which you can also override to use a different text value in your language cust_text.php

topmenu.php

Optionally, you can comment out line 31 of template 2 topmenu.php (Note that the code was wrapped for display purposes below)

	<!-- <img src="<?php echo $cms['tngpath']; ?><?php echo $tmp['t2_headtitleimg']; ?>" 
alt="<?php echo $text['ourpages']; ?>" width="312" height="78" class="noimgborder" /> --> 

and remove the start comments ( <!-- ) on line 39 and end comments ( --> ) on line 45, and change the Our Family<br />Genealogy Pages on line 42 to your own personal text rather than creating a text image.

This option also allows you to use the $text['ourpages'] variable by changing line 50 to use <?php echo "$text['ourpages'] \n"; ?> which will echo the $text variable from your language text.php files so your home page title changes with a dynamic language switch.

Return to Template Settings