Template Manager

From TNG_Wiki
Jump to navigation Jump to search
Template Manager
Summary Supports the loading, unloading, saving, and erasing of template data from the TNG database.
Validation
Mod Updated 26 Dec 2022
Download link v14.0.0.1
TNG 14.0

v13.0.4.1
TNG 13.0.4

v13.0.2.1
TNG 13.0.3
TNG 13.0.2

v13.0.0.1
TNG 13.0.1
TNG 13.0

Download stats
Author(s) Bill Herndon
Homepage Template Manager (This page)
Mod Support Template Manager support.
Contact Developer Email me.
Latest Mod 13.0.0.1 for TNG 13.0 and 13.0.1
13.0.2.1 for TNG 13.0.2 and 13.0.3
13.0.4.1 for TNG 13.0.4+
14.0.0.1 for TNG 14.0+
Min TNG V 12.0
Max TNG V 14.0.4
Files modified
admin_templateconfig.php
Related Mods
Notes
* v12.2.0.0 has not been tested with the commercial TNG templates offered by Marsha Bryant, but assuming that those templates are not stored differently than bundled TNG templates, the mod should be compatible.

Purpose

This mod supports the loading, unloading, saving, and erasing of template data from the TNG database. Local template configuration files having the same format as in previous TNG releases are used to store template data when not resident in the TNG database. The mod can be used to preserve templates across releases or for loading entirely new templates.

Developer

This mod was developed by Bill Herndon

Requirements

  • A working TNG installation.
  • A backup of all affected files (see the list in the summary in the upper right corner of the page)
  • An installed current version of the Mod Manager.

Installation

  1. Uninstall and delete previous version of this mod (if installed)
  2. Download the appropriate zip file as shown in the mod summary in the upper right corner of the page.
  3. Extract the file from the downloaded zip file into the mods folder or FTP the extracted file to your mods folder.
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the mod.

In the event of a problem

Uninstalling the mod

If you want to completely Remove (uninstall) this mod and any tables if created, you should

  1. click the Uninstall button to uninstall the mod
  2. click the Delete button to delete the config file from the mods folder.

Upgrade

  • Uninstall and eventually Delete the current Mod.
  • Proceed as for an installation with the new Mod.

Features

Use Cases

Load New Templates

From TNG 12 on, template parameters and values are stored in the database. For templates already installed prior to a TNG 12 upgrade, this isn't a problem because all the parameters in the existing templateconfig.php file at the time of the upgrade are read and inserted into the tng_template table. Newly installed templates also need a way to have those parameters written to the TNG database. Template Manager's Load function reads a local template configuration file and writes parameters and values to the database. For example, the templates NearDark and NearDawn are now distributed with such a file to support installation using the Template Manager.

Modify or Add Parameters

The Save, Load, and Unload functions support writing a template's parameters to the local file-system and then reloading the parameters back into the TNG database. To add new parameters in an existing template:

  1. Execute Save on the template — This writes template to the file system.
  2. Edit the local _templateconfig.php file, adding new parameters or language specific translations for existing parameters.
  3. Execute Load on the template — When the data from the _templateconfig.php file is written to the database the new or language specific parameters and values are added.

To modify the names of existing parameters, use the same procedure as above but substitite Unload for Save in the first step. This removes the template's data from the database in addition to writing it to the file-system.

Preservation of Parameter Values

The Template Manager supports the preservation of Template Parameter Values Across TNG Releases.

If you are concerned about losing a template's configuration across TNG releases or when installing/de-installing mods, you can always save or unload a template prior to an upgrade or mod installation, restoring its original values after the operation. The Save All and Load All functions can be used to do this for all currently loaded templates.

Operations

For templates currently loaded into the TNG database, four operations are supported:

  • Save - Saves the selected template to a template configuration file in the template's root folder or to whatever subfolder has been set in the mod parameters. The configuration file does not need to exist. It will be created or overwritten. But subfolders (when specified) must exist. The template's data remains in the TNG database.
  • Wipe - Removes the selected template's data from the TNG database.
  • Unload - Executes a Save operation followed Wipe on the selected template.
  • Save All - Attempts to save all currently loaded templates to the TNG installation in their respective template folders.

For templates currently in the TNG installation that have valid template configuration files, the following two operations are supported:

  • Load - Loads data from the chosen template's local configuration file into the TNG database. Existing field values are overwritten. New field values are appended.
  • Load All - Attempts to load all templates in the TNG installation that have valid template configuration files into the database.

Mod Compatibility

TNG 13.0.2 and 13.0.3

With TNG 13.0.2, a slight simplification to line 27 of file admin_templateconfig.php was made:

	if( is_dir($cms['tngpath'] . "templates/template" . $row['template']) ) {

This change causes named TNG templates (i.e., templates that don't use the template numbering system for their directory name), to be skipped. These templates cannot be edited in the TNG database nor loaded from the templates directory by the Template Manager. Template Manager v13.0.2.0a corrects this behavior for TNG 13.0.2 and 13.0.3. For TNG 13.0.4 Darrin Lythgoe has patched the code so that named templates can be used again. Template Manager v12.2.0.0 should work with this TNG release as will PHP-8 compatible version v13.0.4.1.

Revision History

Version(s) Release Date Comments
12.2.0.0
12.0.0.0
27 Feb 2024 Support has ended for Template Manager versions 12.2.0.0 and 12.0.0.0 and the packages are being withdrawn. If you need a Template Manager package for TNG 12, please contact me directly.
14.0.0.1 26 Dec 2022 Minor updates for TNG 14 compatibility and to accommodate Mod Manager matching changes.
13.0.2.1 04 Sep 2021 PHP-8 compatibility.
13.0.4.1 03 Sep 2021 PHP-8 compatibility.
13.0.0.1 03 Sep 2021 PHP-8 compatibility.
13.0.2.0a 05 May 2021 Compatibility with TNG releases 13.0.2 and 13.0.3.
12.2.0.0 13 Oct 2019 Compatibility with TNG 12.2. This version is required for use with TNG 12.2.
12.0.0.0 20 May 2018 Initial release

Sites Using Template Manager

If you download and install this mod, please add your TNG site to the table below:

URL User Note Mod Version TNG Version Language(s)
Lindell-Herndon Genealogy Bill Herndon Mod developer, public site 14.0.0.1 14.0.4 DA, DE, EN, ES, FR, SV
Roots & Relatives Remembered Ron Krzmarzick Public & Private See Here See Here EN,DE,CS
Our Roy and Boucher Family Ken Roy Great mod to preserve template values and help modify existing templates 14.0.0.1
TNG 14.0.4
EN, FR
Hooley Family Links Rick Hooley Public/Private See Here See Here EN
Dabbling in Genealogy Jeff Rueger Public/Private site 14.0.0.1 14.0.3 EN
Woking Family Tree Project TBirdUK Public/Private site - This mod saved my Sanity 14.0.0.1 14.0 EN
Rintoul/Bowman Family Andrew Rintoul Public/Private site 14.0.0.1 14.0 DE, EN, ES, FR
Brabantse Genealogie Rob van Rij Public site 14.0.0.1 14.0 DE, EN, NL
Auf den Spuren meiner Vorfahren UHaase Public/Private 12.0.0.0 12.0.1 DE, EN
Genealogische Datenbank JPB Public see here see here DE, EN, FR
LookingBackwards - All Our Relations Ashleigh Mitchell Public 12.2.0.0 13.0.4 EN
The Severijns / Timmer Familytree Rob Severijns Public / Private - Great Mod ! See here See here NL, EN
Baza danych Rodziny Jarocińskich Michał Jarociński Non-public site. What a useful Mod! 14.0.0.1 14.0 PL,EN
Kielakowie.com Janusz Kielak Public site 14.0.0.1 14.0.1 PL, EN, DE