Full code for templating.