2

I have a header section that's specified in html.tpl.php, but the header should be different depending on what page the user is on. Most of the pages are just a page content type, though I might add other types later, and also the homepage.

What's the best way to specify which header to use and then catch that in home.tpl.php?

I tried creating a custom field for the page content type, but I couldn't figure out how to access it from home.tpl.php, and I'm not sure how you would specify it for other types of pages.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Jane Panda
  • 1,591
  • 4
  • 23
  • 51

1 Answers1

2

If your header consists of things between the <body> tag, perhaps you could create your header in page.tpl.php instead of html.tpl.php. This way you would have access to $node variable and be able to set up your conditional header based on a field or taxonomy term. For something a little more complex, you might want to check out the context module: http://drupal.org/project/context.

bkildow
  • 5,143
  • 4
  • 29
  • 37
  • I'll see if I can move it to page, if that's the easy route I'd rather do that until I get more immersed in Drupal – Jane Panda Feb 01 '11 at 17:30