Description
Function BeforeShow<PageName>
is executed right before a page
is displayed in the browser. Use this event to modify the value of
any template variable or to define a new one.
Syntax
BeforeShow<PageName>(&$xt,&$templatefile)
Arguments
$xt - template engine
object. Use $xt->assign("valueName") to assign values displayed
on the page.
$templatefile - name
of the template file being displayed.
Applies to
List, View, Add, Edit, Print, Search, Export, Report, Chart,
Login, Register, Password reminder, Change password, Menu
Example
To display some text on the List page:
1. Proceed to the Visual
Editor page.
2. Switch to HTML mode and find the line {END
recordcontrols_block}. Add the following code right before it:
<DIV>{$new_variable}</DIV>
|
3. Add the following code to the List page: Before display event.
Note: Change the values listed in
red to match your specific needs.
$new_variable = "test value";
$xt->assign("new_variable",$new_variable);
|
Recommended predefined actions
and sample events
Send a
simple email
Insert a record
into another table
Check to see if a
specific record exists
Display a
message on the Web page
Redirect to another
page
Hide controls on
Add/Edit pages, based on logged user name
|