New to backdrop and trying to basically custom theme from scratch using existing themes as a reference (well, basis at least.)

While there's plenty of workarounds (I could use a php include I suppose for example) - I don't understand how/why header.tpl.php gets used in my layout template when I output:

$content['header'];

...it's not a problem, I just don't see where that's specified in any settings or template files.  If it is, can I do the same for the footer, or is there's something ingrained for the header in particular?

Thanks!

Accepted answer

If you want to customise the footer, you can either:

  • Edit the layout template (to customise the footer region wrappers), or
  • Edit the individual block templates (to customise the footer contents).

Comments

There's two different things going on here:

  1. The header region is being output in your layout via $content['header']
  2. The header block from your layout is being themed via header.tpl.php.

If you remove the header block from your layout, header.tpl.php won't be used anymore. Or if you add other blocks to your layout's header region, they will also be output by $content['header'].

Hope that makes sense.

If you want to customise the footer, you can either:

  • Edit the layout template (to customise the footer region wrappers), or
  • Edit the individual block templates (to customise the footer contents).

Thanks BW, again it's not a problem that's holding me up or anything - just didn't understand why there's a particular header template file but not one for footer.  If that's the way it is so be it, just seemed odd!

I'll just do it in the layout file then (but theoretically I don't see why the header couldn't be done in there just the same.)

Cheers.