PHITE: Elements |
Home > Quick Start > Basic Concepts Elements Blocks Content Snippets PHITE Environment Other Features Security > Code Examples > Tool Examples > Choose Skin > Contact Me > Help > Credits > Downloads > PHITE Sites
|
Elements PHITE pages are built up by snippets of content automatically being inserted into the site template. Snippets come in two basic types, elements and blocks. Elements are snippets that have a single value or content on the page. These elements are used in the .tpl template file between braces thus: {PAGENAME}. Whenever {PAGENAME} is encountered in the .tpl file it is replaced with the contents of the element PAGENAME for the current page. Built-in Elements included in PHITE are:
Defined Elements are defined in the 'Settings' section of the script. The standard distribution of PHITE includes the following defined elements: $elements['BODY'] = array('el_name'=>'BODY', 'acq'=>true); $elements['FOOTER'] = array('el_name'=>'FOOTER', 'acq'=>true); $elements['META'] = array('el_name'=>'META', 'acq'=>true); $elements['DATE'] = array('el_name'=>'DATE', 'acq'=>true); $elements['PRINT'] = array('el_name'=>'PRINT_FRIENDLY', 'acq'=>true);For example, let us take the BODY contents element. The code will look in the current page/subpage directory for a file called BODY.inc or BODY_any_arbitrary_text.inc. The contents of the file found will be substituted for the element {BODY} in the .tpl template file being used. Note that the 'signature' (e.g. 'PRINT') and the entry in the .tpl file (e.g. {PRINT_FRIENDLY}) may have different names. The above defined elements should form a good starting point for a site. You can easily add your own as needed.
Acquisition. The final flag 'acq'=>true (or false) tells PHITE what to do if
the file is not found in the current page or subpage directory. If 'acq' is true, then
it will look to see if it can be found in the containing page or in the {sig}_MAIN directory.
For example, the element 'PRINT' is set by placing a file in the {sig}_MAIN directory and it is
used in the whole site if no other PRINT.inc (or PRINT_somename.inc) files are in any of the
pages or subpages. |
|
|