There is a way around it, which should help give you an idea of how to use TMPL_IF in more efficient ways.
Let's say that you have a page variable ($page) which contains the details of the page that you're currently viewing, take a look at the following code:
?php
//.. first your php code and template instantiation
// $page can equal index, docs, examples or downloads
// you would write your setVar like this
if $page !== null
$tmpl-setVar'page_'.$page, 1;
/*
Now, depending on which page is set, you'll have a var called
page_index, page_docs ... etc
*/
?
.. so your template would do something like:
.... text
tmpl_if name=page_index
Home
tmpl_else
a href=/index.phpHome/a
/tmpl_if
... etc
.. rest of your page
I hope this helps.
I have been thinking about an extended syntax for the TMPL_IF tags and your's is an interesting suggestion, I will think about it a little bit more however.
Kind regards,
Kelvin