M: MainTemplate: add header and footer.