Add templateEngine and headers and footers.