add header and footer from template