Io faccio così per gestire il template:

codice:
switch ($users->getStatus())
      {
	     case STATUS_LOGGED:
		 $usersContent = 'L\'utente è loggato: mostra il messaggio di benvenuto';
		 break;
		 
		 case STATUS_NOT_LOGGED:
		 $usersContent = "l'utente non è loggato: mostra il form";
		 break;
	  }

// Assegno i valori all'array dei box
$_boxTitle['sx'][] = 'boxMenu';
$_boxContent['sx'][] = $usersContent;
Le variabili $_boxTitle['sx'][] e $_boxContent['sx'][] vengono assegnate al template ed interpretate dal file box.tpl

codice:
<table width="97%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" valign="middle">[img]Themes/html/images/boxTopSX.jpg[/img]</td>
    <td width="98%" height="20" align="left" background="Themes/html/images/boxBorder.jpg">[img]Themes/html/images/{$title} .jpg[/img]</td>
    <td width="1%" valign="middle">[img]Themes/html/images/boxTopDX.jpg[/img]</td>
  </tr>
  <tr align="left">
    <td colspan="3" id="box">{$content} </td>
  </tr>
  <tr>
    <td valign="middle">[img]Themes/html/images/boxBottomSX.jpg[/img]</td>
    <td height="20" align="center" valign="bottom" background="Themes/html/images/boxBorder.jpg">[img]Themes/html/images/boxBottom.jpg[/img]</td>
    <td valign="middle">[img]Themes/html/images/boxBottomDX.jpg[/img]</td>
  </tr>
</table>