Difference between revisions of "Templates - Upgrading TNG 8.1"

From TNG_Wiki
Jump to navigation Jump to search
Line 45: Line 45:
 
To position for a future use of the Template Selection and Template Settings capability, you should modify your existing index.php file in the TNG root path which then becomes your main index.php, by adding the following lines to your index.php file.
 
To position for a future use of the Template Selection and Template Settings capability, you should modify your existing index.php file in the TNG root path which then becomes your main index.php, by adding the following lines to your index.php file.
  
The index.php file provided in the special folder as part of the upgrade contains the following lines, that you should insert in your current index.php file, after the db connection and checklogin.php  
+
The index.php file provided in the special folder as part of the upgrade contains several lines, that you should insert in your current index.php file, after the db connection and checklogin.php, immediately before the line
  
 +
<pre>$flags['noicons'] = true;</pre>
 +
 +
These are the lines to insert into your index.php file in the TNG root folder:
  
 
<pre>//Insert the following lines in your index.php to take advantage of template switching
 
<pre>//Insert the following lines in your index.php to take advantage of template switching

Revision as of 11:45, 7 January 2011


Article Under Construction


When upgrading to TNG V8.1, you should copy the templates folders to your site, but you have a couple of options on how to upgrade your templates:

  • use the new Template Selection capability
  • stay at status quo
  • position for future

Template Selection

TNG V8.1 introduced the capability to select a template to be used in the Admin >> Setup >> Template Settings which was provided with TNG V8.

If you change the Enable Template Selection: from No to Yes, TNG V8.1 and above will use the files from the templates/templateN folders where the template used is indicated by the Template Number: selected.

If you use template selection (in 8.1.0) and you choose one of the 8 templates, then TNG will use both the index.php in your TNG root path or main index.php file, which was provided in the special folder in the upgrade, *and* the index.php from your chosen template folder. The main index.php will abort and include the template index.php if it detects that a template has been chosen.

TNG V8.1 template selection.jpg

If you previously used the Template Settings options in TNG V8 to tailor your home page, potentially without having to modify any code in the template index.php file, you should probably use the new Enable Template Selection capability.

Rename your existing index.php file in your TNG root path and then copy the index.php file from the special folder to your TNG root.

Maintain Status Quo

If you have been using TNG for several years and have your own template file, the way you want it, you should probably use the status quo approach, and not copy the index.php from the special folder.

Note that in TNG V8.1 and above if you leave the Enable Template Selection set to No and the Template Number blank, then TNG continues to use the template files from the TNG root folder, whether that be a template you copied from the templates folder, the default TNG template, or one you created yourself.
TNG V8.1 template selection status quo.jpg

According to Darrin's TNG 8.1.0 announcement email, you should also be able to still use the Template Number to configure your existing conditions. However, this requires that you previously copied the template files to the TNG root folder, and may require that you update the index.php according to the upgrade readmexxx-810.html instructions. Note that I have not tested this approach. --Ken Roy 13:24, 5 January 2011 (UTC)

You may however want to position for the future, as shown below.

Position for Future

To position for a future use of the Template Selection and Template Settings capability, you should modify your existing index.php file in the TNG root path which then becomes your main index.php, by adding the following lines to your index.php file.

The index.php file provided in the special folder as part of the upgrade contains several lines, that you should insert in your current index.php file, after the db connection and checklogin.php, immediately before the line

$flags['noicons'] = true;

These are the lines to insert into your index.php file in the TNG root folder:

//Insert the following lines in your index.php to take advantage of template switching
if($templateswitching && $templatenum) {
	include($cms['tngpath'] . "templates/template$templatenum/index.php");
	exit;
}
//end of lines to be inserted for template switching