2

I have a 3 page drupal(6.20) site, each page has its own template like page-node-1.tpl.php, page-node-2.tpl.php, page-node-3.tpl.php, I would like to set separate templates when editing each node, I tried

page-node-1-edit.tpl.php

but its not working, but page-node-edit.tpl is working, but its common to all nodes, I need separate editing templates for each node like page-node-1-edit.tpl.php and page-node-2-edit.tpl.php

Thanks a lot for your time

Thomas John
  • 1,903
  • 4
  • 24
  • 29
  • I asked quite the same thing 1 day ago with no luck. Hopefully someone answers you http://stackoverflow.com/questions/5041667/suggesting-different-templates-when-theming-a-node-form – corbacho Feb 19 '11 at 19:02
  • Looks like duplicate of http://stackoverflow.com/questions/1538600/how-can-i-theme-the-template-for-edit-or-add-a-node-for-a-specific-content-type – yitznewton Feb 21 '11 at 05:27
  • I replied my own question. Have a look if can help you in a similar problem: http://stackoverflow.com/questions/5041667/suggesting-different-templates-when-theming-a-node-form – corbacho Feb 21 '11 at 09:40

1 Answers1

1

Add this function/or modify if exists into template.php of your theme:

function phptemplate_preprocess_page(&$vars) {
  // ...
  $node = menu_get_object();
  if ($node->nid == '1') {
    $vars['template_files'][] = 'page-node-1-edit';
  } 
  // ...
}
Nikit
  • 5,128
  • 19
  • 31