TopLevel ViewTemplate.php - jcobban/Genealogy GitHub Wiki
This script displays a user-friendly view of the contents of a template file. Template files are used to hold the presentation information for a page, separating it from the application logic which organizes information obtained from the server or the network.
The page is split in half. The left half displays how the browser interprets the HTML of the template but with none of the substitutions that would be made by the associated application, and with all "hidden" divisions, including the various help pop-ups, displayed. That is each element of the template is displayed as it will appear to the end user, except that substitution points, where information is inserted from the server, appear as either a dollar sign followed by the name of the substitution point, for example $PAGE
, or as the name of the substitution point enclosed in double curly braces, for example {{PAGE}}
. In addition all of the popup dialogs, which are normally hidden until invoked by user action, are displayed.
Note that the TRACE
insertion point is displayed according to the CSS class "warning" which defaults to dark yellow text, while the MSG
insertion point is displayed according to the CSS class "error" which defaults to red text.
The right half displays the raw HTML with color-coding of HTML elements. For example tag names are in purple, constants are in blue, and comments are in green.
When invoked by method='get'
the parameters are:
parameter | description |
---|---|
'template' | this identifies the template file within the /templates/ directory. |
'lang' | the language selection |
For example:
Note that although there are no links within the site that take you to the actual template files that there is nothing to prevent a user from manually entering the URL of one of these template files. However it is not useful to bypass the use of ViewTemplate.php
because that causes the document to be interpreted as a normal HTML page, whereas templates are incomplete fragments of HTML. Bypassing ViewTemplate.php
is discouraged, for example, by the site interpreting a request to view the contents of a directory that contains static template documents by redirecting to a page which invokes ViewTemplate.php
for each of the templates.
Next: Top Level Implementation