Xinet Portal comes with an extensive list of existing tags for use in customizing the Xinet Portal templates. (See Appendix: Xinet Portal Tags and Templates.) Sometimes it may be necessary, however, to enhance an end-users experience by introducing new data or action buttons not present in the default tags. This section discuss adding Variable Data Tags in both the base Xinet Portal template page and an array of files.
Dynamic and/or static data of all kinds may added to the body area of a Xinet Portal template. This is done by adding a simple script to the local.inc.php file found with the templates of a Xinet Portal Web site. In this example we will add the user’s name and date to a tag as a welcome banner. Once this script is added to the
local.inc.php file, it can be used in any of the templates associated with the current Xinet Portal Web site. To add the functionality to another Xinet Portal Web site, simply copy the script to another Xinet Portal Web site’s
local.inc.php file.
Goal: To display a welcome banner for each user.
Customization method: Create a new string,
$banner, inside the
local.inc. php file, build a new Variable Data Tag, and use it in the
toplevel.tmpl.html file.
To create a script that will display a welcome banner we will use Xinet Portal data to provide the user’s name and the PHP date() function to generate the current date. Refer to the PHP manual (
http://www.php.net/manual/) for the use of
date().
The string assignment in this example creates the variable $banner. Then
$banner is given the static text values of
Welcome and
, the current date is. Dynamic data, the user’s name, is assigned calling the variable
$tmpl->USERINFO['USER']. The current date is also dynamically generated by using the PHP function
date() and formatting the date as month
F, day
j and year
Y: