|
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($name,
$val) to assign a value $val to the variable $name.
$templatefile - name of the template
file being displayed.
Applies to pages
List, Add, 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 BeforeShow 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
|