Hi, Here's what I'm trying to do. I have a side menu which, when a link is clicked, displays a submenu. At that time any previously opened submenus will be closed.
PHP code: $menu_item is a global and is set via url rewritting
if ($menu_item == "reports") {
$reports = array("Report 1" => 'report1.php',
"Report 2" => 'report2.php',
"Report 3" => 'report3.php',
$tbs->MergeBlock('reportsblk', $reports);
}
if ($menu_item == "maintain") {
$maintain = array("Maintain 1" => 'maintain1.php',
"Maintain 2" => 'maintain2.php',
"Maintain 3" => 'maintain3.php');
$tbs->MergeBlock('maintainblk', $maintain);
}
$tbs->Show();
|
html code:
<a href="[var..script_name]?which_button=reports" target="_self">
<img src="b_reports.gif" width="116" height="25" alt="Reports" no border>
</a>
<a href="[reportsblk.val;block=a;when [var.menu_item]=='reports']" target="main">[reportsblk.key]<br>
</a>
<a href="[var..script_name]?which_button=maintain" target="_self">
<img src="b_maintain.gif" width="116" height="25" alt="Maintain" no border>
</a>
<a href="[maintainblk.val;block=a;when [var.menu_item]=='maintain']" target="main">[maintainblk.key]<br>
</a>
|
This nearly works except that [reportsblk.key] and [maintainblk.key] appear under their respective buttons when menu_item=''. They do show the appropriate submenu when the respective button is clicked but the other submunu (the one which isn't supposed to appear) still shows the tbs blk.key tag. If tried the isempty='' parameter but that leaves a space under each main menu item. Does that all make sense? Any help appreciated.
BTW, Skrol29, this template engine totally rocks (despite thte fact that it's hard to get my small brain around it <g>). Thanks for making it available.