Mod Settings Blocks

From TNG_Wiki
Jump to navigation Jump to search

This article describes

  1. A technique that organizes a mod's configuration settings (i.e. mod options) into a bordered block (called a Mod Settings Block) in an Admin>>Setup program, and that labels that block with the mod name,
  2. A mod that, in TNG13, installs the code that all of my mods (with options) depend on to organize and display Mod Settings Blocks, and
  3. An Include-file-sharing technique that I developed for Mod Settings Blocks in TNG12, but that I have replaced with the Mod Settings Blocks mod for TNG13.
- Robin Richmond


Ambox notice.png The latest version of this mod uses the guidelines for TNG v12+ cust_text.php files. If you are using TNGv12+, and any cust_text.php file in this mod is marked with a Bad Target error, you need to update your cust_text.php files before you can install this mod. [Show instructions]

If you upgraded to TNGv12+, and did not update your cust_text.php files as instructed in the upgrade readme script, then you must use the TNG Mod Manager to update them. To do so:

  1. Go to Mod Manager, and select its "Recommended Updates" tab.
    (If the "Recommended Updates" tab is not visible, then go to the Mod Manager Options tab, select "Display Settings", and turn on the "Recommended Updates" tab.)
  2. Click the "Update" button in the "Recommended Updates" tab.
    Installed mods do not interfere with the update, and if you already have (or think you may have) run this update, it will not hurt for you to run it again.

[See details in the TNGv12 Change Impacts Article][Hide the instructions]

TNG 13.0
TNG 12.0


Mod Settings Block - TNG13 Only
Summary Defines fields in Admin>>Setup programs for numerous mod options, where each mod's options are enclosed in a distinctive "Mod Settings Block"
Validation
Mod Updated 28 Sep 2020
Download link v13.0.0.1a
TNG 13.0
Download stats
Author(s) Robin Richmond
Homepage Robin Richmond's Genealogy Database
Mod Support My Mod Support form or TNG Community Forums
Contact Developer My Mod Support form
Latest Mod 13.0.0.1a
Min TNG V 13
Max TNG V 13
Files modified
cust_text.php English & French; Installs: rrmodsettingsblocks.php, img/rrmodsettingsblock_wiki.gif
Related Mods
Notes
All of my mods that have options depend on this mod


Purpose of the Mod

Installs the PHP & Javascript code that creates and formats mod options for mods. Essentially all of my (Robin Richmond's) mod options now use Mod Settings Blocks rather that Mod Manager "%parameter%" tags, and are thus dependent on this mod.

Mod Settings Blocks

My mods options are defined (in Mod Settings Blocks) in the appropriate Admin>>Setup page, e.g.

Mod settings block can best be described by illustrations.

First, I'll note that enough of my mods define Mod Settings Blocks in Admin>>Setup>>General Settings that I have defined a new subform strictly for Mod Settings Blocks.

This screenshot show the first few of several Mod Settings Blocks the new subform in Admin>>Setup>>General Settings. The subform is called "Robin's Mods" in TNG12, and "Mod Settings Blocks" in TNG13. Depending on how many of my mods have been installed on a given site, there could be as many as a couple of dozen Mod Settings Blocks here.
Mod settings blocks13-3blocks.jpg

  • The Wiki logo (a stylized W) is a link to the mod's Wiki Article
  • Each Mod Settings Block has its own "Save" button ("Save All" in TNG12), which, like the other "Save" buttons in the form, means "Save all options defined in this page, not just the ones that are visible".

Here is a single Mod Settings Block, displayed as the result of a link directly to that specific Mod Settings Block. The concept of a link directly to TNG options or TNG options subforms does not exist, but is is possible to link directly to a Mod Settings Block. In this example, a link directly to the Mod Settings Block for the Admin Cemetery Edit mod has automatically opened the new subform and displayed only the options for Admin Cemetery Edit, leaving all other subforms and all other Mod Settings Blocks hidden.

Mod settings blocks13-adminplacessearch.jpg

See also the section "Links to Mod Settings Blocks".

Mod Settings Blocks are non-standard in TNG, but have several advantages over conventional options defined by %parameter% tags in Mod Manager.

[See Advantages and Disadvantages]
[Hide Details]

Advantages

The distinct advantages that Mod Settings Blocks have over options defined by native Mod Manager %parameter% directives are that the options in Mod Settings Blocks

  1. Can be defined through checkboxes, radio buttons, and selection boxes,
  2. Can be validate at the time they are entered,
  3. Can use Javascript as necessary to do things like disable an option that is not relevant when another option has a certain value,
  4. Can be composite values that are built from more than one form field,
  5. Can have pop-up help text that provides more information than typical mod parameter prompts,
  6. Can be combined with related options into tables and lists, and, notably
  7. Can be applied readily to more than one program, and even be used by programs modified by other mods.

In addition,

  1. Programs that are affected by mod options can have links (visible only to Admins) directly from those programs to the relevant Mod Settings Block. That is, if you see program behavior that is driven by an option, and you want to change that option, you don't necessarily have to close the program, return to the Mod Manger, edit the option there, and then return back to the program that is affected by the option.
  2. The prompts, labels, and descriptions for options in Mod Settings Blocks can be translated into languages other than English. (Well, of course, with classic Mod Manager parameters, a prompt can include text in more than one language, but the language cannot be driven by the TNG language setting. Instead, all of the languages have to be visible at the same time.)

Note that some mods do already define their mod options in Admin>>Setup pages, but those options are relatively hidden among all of the many TNG settings. With Mod Settings Blocks, the options for a mod are clearly distinguished from other mods' options.

Disadvantages

  1. Classic Mod Manager Parameters are more familiar
  2. Every classic Mod Manager Parameter necessarily can be set back to a default value, but only a few settings in Mod Settings Blocks can be reset to a default value. For many options, there's no particular need to reset to a default value, but there could be times when a site administrator wants to revert to a default value and the Mod Settings Block form field doesn't supply a reset option.
[Hide Details]

Mod Options

This mod has no options. It supports the mod options defined by numerous other mods.

Compatibility

This mod does not change any TNG programs. Rather, it installs an Include file that is used only by mods that define Mod Settings Blocks. There are therefore no incompatible programs.

Related Mods

Inner Mod Menus link directly to the Mod Settings Blocks for the relevant mods. See #Links_to_Mod_Settings_Blocks below.

Installation

In TNG13, this mod uses the standard installation procedure, with a mod subfolder that installs two files:

  1. rrmodsettingsblocks.php - The code that supports Mod Settings Blocks that are defined by various mods.
  2. img/rrmodsettingsblocks_wiki.gif - An icon that links to a mod's TNG Wiki page from a Mod Settings Block

[Show Installation Details]

Requirements

  • A working TNG installation.
  • An installed current version of the Mod Manager.
  • You should backup files listed in the panel on the right.

Procedure

  1. Remove and delete previous version of this mod.
  2. Backup the files updated by this mod. They are listed in the panel at the upper right.
  3. Download the .zip file, Extract its .cfg file to the mods folder.
  4. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files.

Problems?

  1. Try using the Mod Manager Remove capability
  2. Contact me through My Mod Support form.
[Hide Details]

Links to Mod Settings Blocks

There are two places in TNG applications where links take you directly to a single Mod Options block (as illustrated in the second screenshot at the beginning of this article).

  1. In Mod Manager, where I have contrived the "Edit Options" page to link directly to the mod's options. That is, Edit Options page looks very much like this:
    Mod settings blocks-modmanageroptions.jpg
  2. From an Inner Mod Menu]. Mods that significantly affect a TNG page or that have options that affect a TNG page can define an Inner Mod Menu, which pulls down from the "Mod Information" label at the right end of TNG's standard "inner menu", as in the Admin>>Places page:
    Show inner mod menus.jpg
    which has been affected by three mods, only one of which has mod options. The "Change Mod Options" link for Admin Places Search goes directly to the Mod Options Block for Admin Places Search:
    Mod settings blocks-adminplacessearch.jpg
    (This screenshot, with the subform name "Robin's Mods" was taken from TNG12.)

Implementation

TNG12-Shared Files

In TNG12, there is no Mod Settings Blocks mod. Instead Mod Settings Blocks are implemented by an Include file that is incorporated into every mod that defines a Mods Setting Block. To allow the Mod Settings Blocks code to be contained in (and installed by) multiple mods, the mods use a Mod Manager feature called "Protected Flags" to share the Include files. With the Protected Flag,

  1. There is just one copy of the protected file in the main TNG folder, no matter how many mods use it,
  2. The protected file can be installed by any mod that uses it,
  3. If a protected file has already been installed, other mods that share it do not generate "File installed" warnings, and do not describe the mods as "Partially Installed". Instead they remain "OK to Install", and
  4. The protected file is not removed from the main TNG folder when a mod that uses it is uninstalled. The protected file remain in place for other installed mods that depend on it.

This feature, and my implementation of it in TNGv12, is very handy, but it has turned out to be confusing to some site admins, and I have found it to be difficult to update shared files. The mod that I use in TNG13 is less automatic, but can be updated very easily, and all updates automatically apply to all installed mods.

TNG13-The Mod

Protected files are a very handy way to implement functionality that is shared among multiple mods, but it just turns out that they don't work especially well for the shared Mod Settings Blocks code. Thus, in TNG13, Mod Settings Blocks are formatted and displayed by code that is installed by the Mod Settings Blocks mod, which must be installed before any mods that use Mod Settings Block can be installed.

Revision History

Mod Version TNG Versions Date Note
13.0.0.1a 13 28Sep2020 French translation by Katryne Chauvigné-Bourlaud
13.0.0.1 13 6Sep2020 New mod.

Sites using this mod

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

URL User Note Mod-Version TNG-Version User-language
Robin Richmond's Genealogy Database Robin Richmond Mod developer 13.0.0.1a 13 English
Family tree of Marcin & Emilia Senderski Marcin Senderski Only home page is public 13.0.0.1a 13.0.4 EN, PL
Vitter-Weaver Genealogy Jeffrey Vitter Public site 13.0.0.1b 13.0.3 EN, FR, CH, DE, ES, IT, NO
Hooley Family Links Rick Hooley Public/Private See Here See Here EN
KK's Family History Kathy Kult Public/Private site 13.0.0.1a
TNG 13.0.1
EN
Out Family https://jdewberry.net James Dewberry Private 13.0.0.1a 13.0.3 EN
The Cole / Tanner Family Tree David Cole Public/Private see here see here EN, DE, FR, ES, NL
Die Familie Assent-Metternich Rainer H. Assent Private 13.0.0.1a 13.0.3 DE
Bastiaanssen Genealogy Jan Bastiaanssen Public / Private 13.0.0.1a 13.1.2 EN, NL, ES
Roy Family Genealogy Rob Roy Public 13.0.0.1a 13.1.1 EN
Delvee Family Association Rob Roy Public 13.0.0.1a 13.1.1 EN
Sejarah Thümann Jeffrey Thümann Public 13.0.0.1a 13.0.3 NL, EN
Joseph Oran Holtz Genealogy Pages Jim Holt Private See Here See Here EN
Osage County Cousins Larry G Banks Public / Private 13.0.0.1a 13.1 EN
Huygens - Van de Moortel Tom Huygens Public/Private on WordPress 13.0.0.1 13.1.2 NL
MOTYER Family Genealogy John Mark Motyer Public site See here See here EN
Your Roots are Showing Harold Craswell Public/Private See Here See Here EN
Van Peer Project Drew McClenaghan Private Site 13.0.0.1 12.3 EN
Daniel Bender - Generations Allison Sibert Public/ Living Private 13.0.0.1a 13.1.2 EN

See Also