4

So, I must be missing something. I want to create a specific template for a Basic Page with Drupal 7. I've read about doing something like creating a file called page—mypagename.tpl.php, and putting it in the theme folder but this has not worked for me. Can anyone provide a quick walk through for this?

Drupal makes my head hurt. :\

Thank you.

apaderno
  • 28,547
  • 16
  • 75
  • 90
a.m.
  • 2,108
  • 5
  • 24
  • 29

1 Answers1

3

Make sure to clear your cache in Drupal after major theme changes which include adding files to the theme as above, otherwise your theme may not pick up the new files.

Last I checked, the Devel module was still buggy for D7, but if it has come along then I highly recommend using this along with the devel_themer module, it has a tool that will tell you what exactly to name your theme files for different elements (pages, nodes, fields, etc).

Shannon
  • 2,744
  • 3
  • 28
  • 37
  • Thanks for the reply. Is there any sort of "hook" functions that I need to put in the page template? – a.m. Mar 17 '11 at 21:29
  • If you're just trying to override the whole page template as a whole, adding a specifically named tpl.php file into your theme should do it. Hooks are more common with specific elements (think form fields), links, etc, but that's a broad subject in itself. – Shannon Mar 17 '11 at 21:40
  • So, resolved... I was thinking if I named a page "mypage" then I would simply use page--mypage.tpl.php HOWEVER Devel (Theme Developer) says the candidate templates where "page--node--##.tpl.php ( it also said it was supposed to be page__node__##.tpl.php) So as it were using the NODE ## worked for me. Silly Drupal and Stupid Me. – a.m. Mar 18 '11 at 00:47