This is not possible, I'm afraid. Templating is relatively "dumb". In part because it needs to remain simple to use and in part because it should be possible to expose it for editing to regular admins. Having active code running would create a security hole. For more details about the philosophy behind this check out this blog post:
http://www.bring2mind.net...d-things-simple.aspx Peter