Templates - Explained

From TNG_Wiki
Revision as of 22:16, 1 January 2012 by Phaedrus428 (talk | contribs)
Jump to navigation Jump to search

TNG Templates

The TNG install folder contains the default TNG template.

TNG also provides several templates that can be used to customize the look and feel of your TNG site. Starting with TNG 7.0 a templates folder provides the individual templates.

In order to choose a template, take a look at Darrin's demo site and try the pages with the various templates (1 through 8) and then decide which one you want to use.

After deciding which template you want to use, copy all the files from the templates\templateN folder (where N is 1 through 8) to your TNG install folder. You will need to overlay some files like footer.php, templatestyle.css, topmenu.php, index.php, and others, so you may want to rename or backup the files that are to be overlaid before replacing them. All the files in the specific template folder should be copied over the default TNG template files which are comprised of the following elements:

genstyle.css

The genstyle.css defines the standard TNG styles used. If necessary, the templatestyle.css in each specific template provides the specific overrides to the style for the look and feel of that template.

meta.php

The meta.php is included in each page by the tng_header function based on the file being specified in Setup >> Configuration >> General Settings >> Site Design and Specification Custom Meta. It provides the standard TNG meta parameters used. You can add your own <meta> statements to this file. The meta.php provides the $cms[tngpath] for the CSS style sheets so that it works correctly for histories added using the historiestemplate.php

The meta.html file was eliminated in TNG 7.0.0 full install. It is in the special folder for the upgrade. If you use the meta.html file, you need to edit the paths to provide absolute paths to the style sheets.

templatestyle.css

The templatestyle.css, which is new with TNG 7.0.0, contains the overrides to the TNG styles defined in the genstyle.css for the specific template and replaces the version of the genstyle.css previously included in the template folder.

The templatestyle.css is also be used to override the tngtabs1.css or tngtabs2.css file for the template.

mytngstyle.css

The mytngstyle.css file is designed to provide your overrides to the TNG genstyle.css and the template style sheets -- templatestyle.css, tngtabs1.css or tngtabs2.css files.

If you want to make changes to the TNG styles, the templatestyle.css defined styles, or add your own styles, you should make the overrides or additions in your mytngstyle.css so that your style changes will not be lost in a future release or upgrade of TNG.

Templates - Overriding provides an example of how to override the styles.

Templates - Add new style provides an example of how to add a style.

topmenu.php

The topmenu.php file is included in each page by the tng_header function based on the file being specified in Setup >> Configuration >> General Settings >> Site Design and Specification Custom Header. It provides the banner or top section of each TNG page and for some templates provides the left navigation area menu. The topmenu.php contains the <body> statement but not the end of body </body> statement. So care must be taken when editing this file that your editor does not try to correct the syntax, as normally would happen with editors like FrontPage.

The template topmenu.php files were updated in TNG 7.0.0 to remove hard-coded style and formatting information and instead use style class= statements

You may need to use a utility like WinMerge in Windows to compare the new topmenu.php file with your previous version of the template file in order to update your previously modified version of the topmenu.php file

The topmenu.html file was eliminated in TNG 7.0.0 full install. If you allow dynamic language switching, you must use topmenu.php file in order for the menu text to switch language.

footer.php

The footer.php file is included in each page by the tng_header function based on the file being specified in Setup >> Configuration >> General Settings >> Site Design and Specification Custom Footer. It provides the footer of each TNG page.

The template footer.php files were updated in TNG 7.0.0 to remove hard-coded style and formatting information and instead use assigned style class= statements

You may need to use a utility like WinMerge in Windows to compare the new footer.php file with your previous version of the template file in order to update your modified version of the footer.php file.

The footer.html file was eliminated in TNG 7.0.0 full install. If you are supporting multiple languages, you needed the footer.php file in order for the text to switch language.


index.php

Each template provides an index.php that can be customized as the home page for your site. You need to use the index.php from the template folder that matches the look and feel you have chosen for your site.

Related links