Organization of a Page - jcobban/Genealogy GitHub Wiki

Up: Home

As displayed by the user's browser each unit of functionality is presented as a page consisting of a header portion, a main body, a side portion, and a footer portion. In the current standard site layout the footer is empty. Each page is implemented in a set of files which are associated by a common prefix:

  • The server portion of the application is a PHP script “pageName.php” which is invoked by the browser and collects the information from the database and other resources available on the server which is required to be displayed to the user.
  • The client portion of the application, the portion which runs within the user's browser, is an ECMAScript (a.k.a. JavaScript) file “pageName.js” in the same directory folder as the PHP script. This script acts on user input, particularly mouse actions and keystrokes, to respond dynamically. The script typically provides guidance to the user in performing the functions of the page including warning the user if incorrect values are entered.
  • An optional Cascading Style Sheet (CSS) document “pageName.css”, contained in the same directory folder as the PHP script, which controls the appearance of elements within the presented page, if there are elements which require styling which is specific to the page. Most appearance is controlled by the site stylesheet “styles.css”.
  • One or more HTML template pages, contained in the templates directory of the site, which permit customizing the layout of the page for specific contexts independent of the service logic. These template pages are named “pageName$ll.html” or “pageName$option$ll.html”. $ll is the ISO 639-1 2-character language code in lower case, for example “en” for English or “fr” for French used in the page, optionally qualified by an ISO 3166-1 country code in upper case using Internet Best Common Practices 47 notation, for example "en-US" or "fr-CA" or "es-MX", permitting customization for particular target audiences. $option provides the ability to customize the page based upon the authority granted the current user. For example many pages have a “Display” option for users who do not have permission to update the information being displayed as opposed to an “Update” option for users who do have the authority to update the information.
  • One or more language specific help pages which describe the use of the page as a whole. These pages are identified as “pageNameHelpll.html” where “ll” is the ISO 639-1 2-character language code in lower case, for example “en” for English or “fr” for French used in the page, optionally qualified by an ISO 3166-1 country code in upper case using Internet Best Common Practices 47 notation. Note that in language-specific templates you can safely define a link to a language-specific help page before creating that help page because the system will automatically substitute the English version of the help page “pageNameHelpen.html” if the specific help page is not present.

Next: PHP Programming Guide