A: 

In this case, turn it into three distinct template files:

  • a single $ERRMSG template
  • one "You must login.." page
  • and a form

The application logic should define which of the three cases gets displayed.

mario
Got the job done using your method thank you. Adding more and more templates will be hard for the designer to maintain, is that the only way this can be done, is that the logic behind "templates"?
atno
No, it's a constant act of balancing. Splitting up templates is one way to avoid logic. But obviously you'll end up with a hundred files in the end. I based my decision in this case on the assumption that all three parts might accomodate wildly different layouts/styles. It also depends on the template scheme which method is more optional. For heredoc templates I'd use for example `{$include($err ? "error.tpl" : "ok.tpl")}`. But there is really never an optimal solution for alternatives/template parts.
mario