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 14.0.0.1 for TNG 14.0+
13.0.4.1 for TNG 13.0.4+
13.0.2.1 for TNG 13.0.2 and 13.0.3
13.0.0.1 for TNG 13.0 and 13.0.1
Min TNG V 12.0
Max TNG V 15.0
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

Bill Herndon

Requirements

  • A working TNG installation (v12.0 - v15.0)
  • 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

  • Try using the Mod Manager Remove capability
  • Copy the backup of the affected files back to your TNG directory
  • Contact the developer through the 'Mod Support' link.

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 have been 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. Please use the macros for TNG version numbers and do not add indirect "See here" links to the version number cells. The mod developer uses this table to track mod usage by version. Thanks.

URL User Notes Mod Version TNG Version Language(s)
Lindell-Herndon Genealogy Bill Herndon Mod developer, public site 14.0.0.1
TNG 15.0
DA, DE, EN, ES, FR, SV
Roots & Relatives Remembered Ron Krzmarzick Public / private 14.0.0.1
TNG 15.0
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.6
EN, FR
Hooley Family Links Rick Hooley Public / private 13.0.4.1
TNG 13.1.2
EN
Dabbling in Genealogy Jeff Rueger Public / private 14.0.0.1
TNG 14.0.5
EN
Woking Family Tree Project TBirdUK Public / private - This mod saved my Sanity 14.0.0.1
TNG 14.0
EN
Rintoul/Bowman Family Andrew Rintoul Public / private 14.0.0.1
TNG 15.0
DE, EN, ES, FR
Brabantse Genealogie Rob van Rij Public 14.0.0.1
TNG 15.0
NL, EN, DE, FR
Genealogie van Rij (Riede, Reij, Rije) Rob van Rij Public 14.0.0.1
TNG 15.0
NL, EN, DE, FR
Genealogische Datenbank JPB Public 14.0.0.1
TNG 14.0.5
DE, EN, FR
All Our Relations Ashleigh Mitchell Public 14.0.0.1
TNG 14.0.6
EN
The Severijns / Timmer Familytree Rob Severijns Public / private - Great Mod! 14.0.0.1
TNG 15.0
NL, EN
Baza danych Rodziny Jarocińskich Michał Jarociński Private. What a useful Mod! 14.0.0.1
TNG 15.0
PL, EN
Kielakowie.com Janusz Kielak Public 14.0.0.1
TNG 15.0
PL, EN, DE
Family Histories Steven Davis Public 14.0.0.1
TNG 15.0.1
EN
Osage County Cousins Larry G Banks Public/Private 14​.0​.0​.1
TNG 15.0
EN