Template Settings

From TNG_Wiki
Jump to navigation Jump to search
Ambox notice.png The Template Settings feature was added to Admin >> Setup >> Configuration in TNG version 8.0 to facilitate changing your Home page without having to modify the code in the index.php file.
TNG 8.0

TNG 8.1.0 and above

TNG version: 8.1.0

TNG 8.1.0 introduced the capability to Enable Template Selection, which eliminates the need to copy template files from one location to another. To use the new capability,

  • change the Enable Template Selection from No to Yes
  • select the template number in the Admin >> Setup >> Template Settings that matches the template you want to use.

Existing users who want to maintain the status quo, should leave the Enable Template Selection as No and leave the Template Number as blank.

TNG V8.1 Impact

TNG version: 8.1.0

Note that if you were using the Template Settings option in TNG V8 and in TNG V8.1 are using the Enable Template Selection capability, you can no longer put images in your own folders or use an image that is in a different folder such as photos/thumbs/ shown in the above image. TNG V8.1 expects all images used in the template files to be in the templates/templateN/img folder. Therefore you will need to

  • Update the Template Settings to change the entries that specified user or other TNG folders to indicate only img/imagename.jpg
  • Copy the images to the specific templates/templateN/img folder

If you were modifying the template files directly, this will not impact you.

TNG 8.0.0 to 8.0.2

TNG version: 8.0

This article provides instructions for changing Photos and Text for the Templates in TNG V8 using the new Admin >> Setup >> Template Settings capability.

Note that in order to use the new Template Settings in TNG V8, you must:

  • have copied the new templates/templateX footer.php, index.php, and topmenu.php files and overlain your previously manually edited Home page
  • have copied the new templates/templateX/img folder to your TNG img folder
  • have copied the new templates/templateX/css folder to your TNG css folder
  • select the number in the Admin >> Setup >> Template Settings that matches your template. Selecting a number does not select a template to be used, but rather selects a template to be updated


If you provide multiple languages on your site and want to also provide your home page in the different languages, you may want to install the Template Settings - Multi-language Mod

Note that for the Template Settings - Multi-language Mod to install, you also need to copy all templates/ folders to your site. The alternative is for you to edit the mod so that it only applies to the template you are using.

Note that the Template Settings does not entirely eliminate the need to edit your index.php, if you previously added or want to add other display options to your Home page, such as last updated or unique surnames. The problem here is that you can't include PHP code within PHP code. In other words, everything entered in the Template Settings is displayed on the page as part of a PHP "echo" statement. If the text that you echo (or print on the screen) contains more PHP code, that code will be ignored. To get what you want, you will therefore need to paste this code directly into your index.php page.

Can you enter

HTML codes

You should be able to use html codes within the textarea input boxes (the larger areas on the Template Settings page) such as

  • used in Template 6
<a href="extrastree.php?personID=I40&tree=T0001&showall=1">Maxime Roy</a><br/>
  • used in Template 8
<b>5 Jan 2011</b> - J'ai ajouté un nouveau regard entier à mon site Web. <br/><br/>

Note: that if you code the ampersand using the html code & amp; it will initially pass validation. However, as soon as you open the Template Settings again, it will revert to a normal ampersand, so that once you save it again, it will not pass the validation checks. This is expected behavior when using <textarea> which are not expected to contain html code.


PHP code

You cannot use PHP code since a PHP echo statement is used to display the $tmp (template) variables. Therefore you cannot enter

  • variables, such as $currentuser, or
  • echo statements, such as <?php echo "string"; ?>

as a PHP variable cannot contain PHP variables or code inside itself.

See also