Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
Source Link
kevindeleon
  • 307
  • 2
  • 11

Appropriate way to include a PHP file in a theme tpl

I guess this is more of a "Drupal way" question than a technical question. I have a multi-site install with a base-theme shared by all of the sites. The base theme has two 'page' theme files (one is specifically for the homepage). As you can imagine, there are shared elements to the layout (let's say a header and footer for conciseness). I'd like to keep the 'header' and 'footer' in separate PHP files so that I have one place to edit them versus going into 2 separate files and editing four blocks of code if something changes.

What is the appropriate way to create php files for 'header' and 'footer' and include them in the page.tpl and page--homepage.tpl templates?

Should they be in a folder called includes with a .inc extension, should this not be done at all, etc..?