i use different layouts for different pages for a large website, which share common header and footer. how can i create common header and footer templates and link the templates to these pages.

  • I think you will need to customize the header and footer in your page.tpl.php file – Fahad Ur Rehman Mar 9 '13 at 9:27

The most common is to structure your header and footer using the core block system. Another solution would be to place the structure in the page.tpl.php. If you have a lot of page.tpl.php files and still want to use templates, then it might be better to place the header and footer in the html.tpl.php template.

Personally I would recommend using the blocks system.


Way to do this, creating region--header.tpl.php and region--footer.tpl.php, which contains the html structure for header and footer region. Make sure tat base template file region.tpl.php file is included.

For dynamic header and footer, use blocks. And for static header and footer section, write html code in the header and footer template files. And for semi-dynamic portion, combination of both can be used.

However there should be a block atleast in the header and footer region to take effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.