yo dev-squad!
tryin to handle conditional display
getting data from mysql table,
i try to display different templates
field "type" should be my switch
wheres my mistake? could someone help me out...?
cheers
phil
////////////////////////////////////////////////// TEMPLATE :: HTML
[blk_paged;block=begin]
[blk_paged.type;if [val]='A';then [onload;file=[var.CFG.root_dir][var.TPL.path]content/directory_company_type_a.tpl.htm]]
[blk_paged.type;if [val]='B';then [onload;file=[var.CFG.root_dir][var.TPL.path]content/directory_company_type_b.tpl.htm]]
[blk_paged;block=end]
////////////////////////////////////////////////// PHP :: SIDE
include_once "inc/common.inc.php";
$mod = "Directory";
$paging = true;
#$CFG["debug"] = true;
// template settings
$TPL["nav"] = get_template("nav/nav_index.tpl.htm");
$TPL["template"] = get_template("content/directory.tpl.htm");
// search
include_once "inc/paging_search.inc.php";
// sql
$sql = "SELECT * FROM xyz";
// paging
include_once "inc/paging.inc.php";
// template
init_template($TPL["template"]);
// fire
include_once "inc/common_outro.inc.php";
|