Loading...
Changes Saved.
Error Occurred!

KnowledgeBase

Customize the look/feel of SupportTrio

SupportTrio 2.50 introduces a new way to customize the look and feel of both public and admin section of your SupportTrio by using the Smarty Templating Engine. Template sets can be found (and new template sets should be placed in) the "templates" directory.

SupportTrio comes with two templates: public and admin, which you can modify to suit your needs. The only limitation is that SupportTrio is hard-coded to load certain files, so you must preserve the file names of template files.

All the dates that SupportTrio passes to Smarty are in this format "2005-11-29". All date/time strings look like "2005-11-29 22:58:49". If you wish to use a different representation of dates, you will have to use Smarty modifiers acpdate or ttdate to customize it to suit your needs. If you have a variable $dateString to hold a date from example format 1, you will have to find where is it displayed in Smarty template first. It should look like this:
{$dateString}
Simply change that line into (for example):
{$dateString|ttdate:'m/d/Y'}
or:
{$dateString|acpdate:'%m/%d/%Y'}
To get a result "11/29/2005".

The difference between acpdate and ttdate:
ttdate uses a native PHP function date() to format the date/time string, while acpdate uses strfdate(). ttdate has more options for formatting dates, but unfortunately it doesn't use localized values for names for day of week, month, etc. If you wish to have those names in your own language, the suggested modifier would then be acpdate. To find out what types of formatting strings you can use in ttdate except for 'm/d/y', please visit http://www.php.net/date . For information about acpdate formats, please visit http://www.php.net/strfdate .

Changing your server's locale settings:
If you wish to change your server's locale settings, you can easily edit a file /admin/engine.inc.php, and add:
setlocale(YOURLOCALEHERE);

before the ending ?>. You can read more about that function here: http://www.php.net/setlocale


One important piece of information to keep in mind if you want to create your own templates is about the use of the {debug} Smarty tag. If you place this tag in any template file, it will show you the available variables for that template.

You can find documentation on Smarty at their website, http://smarty.php.net.



Related Articles