How TNG builds a page
This page provides a brief overview on how TNG builds a page. It is meant primary for non-progammers to help them understand how the TNG dynamic pages are created. TNG Users who want to make changes may need to see the How TNG builds a page - Details The images below were accurate as of TNG v8.1.3 when this page was create in 2011. The flow is very similar in the current TNG version |
|
In order to effectively troubleshoot or enhance your site, you need to know how the informaiton gets put on the user's screen. How does the HTML file your visitor looks at get constructed from the php file that they select? It's an exceedingly convoluted process, and it's easy to get lost.
Let's try to map this out. For the text based folk among us, here's the list of files and the order in which they are called.
Starting with ANY main php file on your site - any "menu item" link:
TNG version: | ≥ 11.0.0 |
- tng_begin.php
- begin.php
- subroot.php
- tngconnect.php - include database connect and other database functions
- config.php
- customconfig.php
- templateconfig.php
- siteversion.php
- getlang.php
- link to database - connect to database - nothing in the previous files can refer to things in the database, because it has not yet been connected, errors will result
- [optional files depending (mapconfig, cmsevents, etc.)]
- genlib.php
- getlang.php
- language/text.php
- tngdblib.php - include database query functions
- checklogin.php
- log.php [personlib.php, functions.php]
- begin.php
- [variables and scripts for this file]
note that up to this point, only variables have been created, the web page has not yet been started - tng_header
- create doctype and xmlns lines - this is the beginning of the actual web page
- <head>
- title, keywords, description, scripts
- css files
- responsive tables scripts
- $custommeta => load your custom meta file as defined in Admin Setup
- </head>
- $customheader => load your custom header file as defined in Admin Setup and Template Settings
- <body>
- tng_icons (the three button menu that you put on left or right)
- [stuff in the file]
- tng_coreicons (links enabled in Admin Setup - home/login/search/print/bookmark)
- [stuff in the file]
- tng_footer
- tng_basicfooter
- stdsitecredit.php
- $customfooter => load your custom footer file as defined in Admin Setup and Template Settings
- load some scripts
- end.php
- </body>
- </html>
- tng_basicfooter
TNG version: | ≤ 8.1.3 |
- begin.php
- subroot.php
- config.php
- customconfig.php
- templateconfig.php
- [optional files depending (mapconfig, cmsevents, etc.)]
- genlib.php
- getlang.php
- text.php
- connect to database - nothing in the previous files can refer to things in the database, because it has not yet been connected, errors will result
- checklogin.php
- [log.php, personlib.php, functions.php]
- [variables and scripts for this file]
note that up to this point, only variables have been created, the web page has not yet been started - tng_header
- create doctype and xmlns lines - this is the beginning of the actual web page
- <head>
- title, keywords, description, scripts
- css files
- $custommeta => load your custom meta file as defined in Admin Setup
- </head>
- $customheader => load your custom header file as defined in Admin Setup
- <body>
- tng_icons (the three button menu that you put on left or right)
- [stuff in the file]
- tng_coreicons (links enabled in Admin Setup - home/login/search/print/bookmark)
- [stuff in the file]
- tng_footer
- $customfooter => load your custom footer file as defined in Admin Setup
- load some scripts
- end.php
- </body>
- </html>
tng_header, tng_icons, tng_coreicons, and tng_footer are all functions defined in the file genlib.php
Some of the information on how TNG builds a page can be found in the Genlib Functions article.