Mod Manager - Edit Parameters

From TNG Wiki
Jump to: navigation, search
Ambox notice.png The following information on Edit Parameters pertains to TNG 10.1.


See the Mod Manager - Edit Parameters - prior to TNG 10.1 for information on previous versions.

TNG 10.1.0


Parameters

The TNG V10.1 Manager supports creating Edit parameters that allow the user to tailor the behavior of a TNG mod for their own installation. As a term, "parameter" applies to any variable that is uniquely assigned a value within the script, usually one that controls some aspect of site/mod functionality. By setting their values with %parameter:% directives, the Mod Editor will become available in Mod Manager to allow users to customize them. By setting a mod parameter a webmaster could, for example, prevent exposing information to certain users, or could conveniently change the color scheme for a custom form.

The following directives can be used to create Edit parameters:

  • %fileoptional:% is used after a %target:filename% keyword to indicate that if the file does not exist, no error should be generated. This is useful when describing parameters in a file that will be created during the mod installation.
  • %parameter: % is used to provide the variable whose value can be changed via the Edit function. See the cfg files for examples below. This keyword triggers the Mod Manager to present the option to EDIT parameters after a mod has been installed. The Edit screen will use the %desc keyword to provide a label describing a parameter edit field. Once entered, the parameter value will be stored in the targeted file and will also be updated in the config file.
  • %desc: % is used to provide a description of the editable parameter and the default value for the parameter which should be included within parentheses. See the cfg file examples below.

Restrictions

The following information on Edit Parameters pertains to TNG V10.1 and above:

  • Default values for the variable need to be specified within the %desc: keyword surrounded by parentheses, so parentheses cannot be used as part of other text within that section.

Edit Option Screen

The following is an example screen of the Edit Parameter that shows the following changes made in TNG 10.1:

  • Update is for the individual parameter only
  • Restore Default is for the individual parameter only

Mod Manager edit parameters.png

The above changes were made to allow Edit Parameter to be used for more than one target file. Since the Update and Restore Default buttons ONLY update one parameter at a time, changes to parameters other than the input field where you click the Update button will be ignored and revert back to what is currently in the target and config file.


Config File

In TNG 10.1 and above, it is no longer necessary to verify and replace a location in the target module for the Edit Parameters to be applied. The config file source for the above screen now only specifies the parameters that can be edited.


        // specify edit parameters for extensions/link_wiki1.php
%target:extensions/link_wiki1.php%
%fileoptional:%
%parameter:$wiki_url:http://localhost/wiki%
%desc:Enter your Wiki URL address.  The default is (http://localhost/wiki) %
%parameter:$wiki_url_type:/%
%desc:Enter  your Wiki URL style, this depends on your server and MediaWiki  installation.  One option is a simple "/", the other is "?title=". The  default is (/) %
%parameter:$wiki_prefix:wiki2_%
%desc:Enter your Wiki Database table prefix used during the Wiki Installation. The default is (wiki_)%
%parameter:$wiki_open_new:n%
%desc:Open  existing MediaWiki page links in a new window. The default  is (n).  Change it to y if you want to open in new window or  tab.  Does not affect links to create new pages.%

        // specify edit parameters for extensions/persons.php
        //        that must be copied to your wiki/extensions folder after making the edit
%target:extensions/persons.php%
%fileoptional:%
%parameter:$tng_url:http://localhost/tng%
%desc:Enter your TNG URL address.  The default is (http://localhost/tng) %
%parameter:$treeID:myTreeID%
%desc:Enter your TNG Tree ID.  The default is (myTreeID) %

Related Links

Mod Manager

Mod Manager Controls

For Mod Developers

Other Uses of Mod Manager: