I think that it is possible to work with the examples of TSG but two rule must be established well:
1)
<?hfs
if ($section = "section") {
$section
} else {
$section1
}
?>
The use of <?HFS ?> has to return no result.
We have to declare specific variables to work correctly in this environment ($variable) or the other shape not to be confused with the existing
2) Creation of a macro specific to return one or several results to the order of execution (in the style of document.write)
$return ...
or {{return result| ....}}
****
In the final, we shall have an appearance of javascript but executed quoted to server
[quote
]<?hfs
$return "begin of macro";
if ($section = "mysection") {
$return {{section|$section}};
} else {
$return {{section|$section1}};
}
$return "end of this 'macro' ";
?>[/quote]