Templates

This deals specifically with the secure-portal.co.uk website and has nothing to do with the portals created by SCP users. For information regarding portal styling and general editing in portals see Portal Management.

All code used by the SCP website is placed into files with .PHP, .CSS or .JS extensions. Email templates are an exception and these use .HTML

  • PHP includes server side PHP code and HTML.
  • CSS contains CSS code
  • JS contains JavaScript

Template files have a PHP extension and can be found under the tpl/ folder. Folders are organised into languages using the international two letter abbreviation and en (for English) has been used as the default. Fore more details on changing the language please see Changing The Language.

The templates are divided into sub folders named by the the file they are associated with. For example in the root folder a file name about.php contains a variable named $tpl which points to the appropriate sub folder which is 'about'.



article-content.php is a common template that appears in most web pages and convers the main content area. To the side of the page is a vertical bar called a sidebar and is defined in a file called left-sidebar.php. This will appear in a web pages sub folder if it is different from the default. In most cases a common sidebar in use which changes only if it is for an "outside" area or "inside".

  • outside refers to public areas of the website that can be seen by anyone, whether logeed in or not.
  • inside refers to areas that can only be seen by people logged in.



As the template files use a PHP extension plain text, html and php can be used as required.

Where can I find the text I need to edit?

There are multiple locations the text for any given page can be found. Although no hard rules are set to finding can be easier if you consider the position and purpose of the text on the page. The following guide will be correct most of the time.

  • Left Sidebar will be found in the left-sidebar.php file found in tpl/en/default/inside or tpl/en/default/outside. It may also be found under a specific pages sub folder, for example tpl/en/dashboard
  • Main Page Body will be found in tpl/en/page/article-content.php where page is the name of the page you wish to edit, this subject to the following rule.
  • Language File in lang/en/lang.php will contain strings that appear in PHP (or strings buried in php system files, a dark and mysterious place that not even programmers wish to revisit).
  • The Page Itself for example, if you wish to edit text on the about page you could start by opening about.php in the root folder. However in this case the main text (the text you probably wish to edit) will be found in tpl/en/about/article-content.php






Programmer Notes