Notes for templates - variables, constants, functions
For the design of templates, it is important to know what variables and usable functions there are and what they bring. Below are all available variables and functions described in the index.php of the template can occur.
Important variables or constants
Normally it is enough in a template constants and functions to use, but also variables or arrays are possible. This allows all the variables of the system language file in a template to be integrated (eg, $TEXT['MENU'] could be heading for a menu block is).
| Constants | Description |
|---|---|
| LANGUAGE | Current language |
| DEFAULT_CHARSET | Current charset |
| TEMPLATE_DIR | Directory of the current template |
| BC_URL | Relative root directory of BelCal |
| FRONTEND_LOGIN | Query option, whether login (admins) is on or off (true/false) |
| FRONTEND_ACCESS | Query option from version 2.72, whether login (users) is on or off (true/false) |
| SHOW_MENU | Query option, if multiple menus on or off (if so, the menu is always displayed, otherwise only from 2nd Object) - PROFI-Version |
| SITE_TITLE | Page title for entire project from options* |
| SITE_HEADER | Project header from options* |
| SITE_DESCRIPTION | Project description for search engines from options* |
| SITE_KEYWORDS | Project keywords for search engines from options* |
| OBJECT_TITLE | Title of the current object* |
| MENU_TITLE | Current menu item called* |
* With this character constants are labeled better than functions.
Important functions for templates
- object_title('spacer','template')
There is one line in the template is generated and displayed, the spacer is used as a separator.
For example: object_title('-','[SITE_TITLE][SPACER][OBJECT_TITLE]') creates the line "Project Title-Object Title" (the default setting without parameters).
Can be used SITE_TITLE, OBJECT_TITLE, MENU_TITLE. - object_description() / object_keywords()
These functions generate the description and keywords for search engines. The data from objects when they are covered, otherwise the data from the Options (SITE_DESCRIPTION und SITE_KEYWORDS). - object_header('dateformat') / object_footer('dateformat')
It will be the header or footer of options is generated and displayed, where "dateformat" is only needed if in options the variable [YEAR] (current date) has been used. As stndard format is set 'Y' for four-digit year. - show_menu(parameter)
This function creates the menu. For the parameters see menu formatting. Without parameters are the default parameters used for a simple representation is sufficient. - object_content(block)
Show the sections of an object. For block number is used as the template, the default is block=1 (main content). Blocks are only available in the PFOFI version. - show_login_form(type, redirect, nl)
It will create a registration form and presented.
For exemple: show_login_form('users') generates a login form for registered users in the frontend. Can be used as a type 'users', 'admins' or 'guests'. To redirect is a specified object (default is current object). The nl stands for the newline, and means that the fields are displayed with newline (default). It can be used here '<br />', '<hr />' or ' ' for fields display in one line. To use this login form, you must have the frontend login or access enabled in the options. - register_frontend_modfiles('css') / register_frontend_modfiles('js') / register_frontend_modfiles('jquery')
With this function, the files frontend.css and/or frontend.js are imported from modules when they are available. In addition, a patch for the display of transparency in png graphics for IE < 7 so integrated. If one of these functions are not specified, then the associated functions can not be used.