Global markers should be replaced as early as possible
There are some global markers, like
###TOTAL_RECORDS### which can be replaced as the first thing in the template, so that they are available outside of any loop. This is useful, for example, for having a general IF statement wrapped around the whole template.
[BUGFIX] Evaluate global variables early
Global variables markers should be evaluated as early as possible
so that they can be used in global conditions.
Reviewed-by: Francois Suter <email@example.com>
Tested-by: Francois Suter <firstname.lastname@example.org>