I have recently installed Drupal 7 and am trying to create a custom node EDIT form.
In Drupal 6 I would do the following in hook_theme():
$reg['bgshouse_node_form'] = array(
'arguments' => array('form' => NULL),
'template' => 'node-bgshouse-edit'
);
return $reg;
I of course tried this in Drupal 7, but could not get it to work.
After that failed (and I read some docs, and poured thru some more docs), I tried something like this in hook_theme():
$reg['gstcourse_node_form'] = array(
'arguments' => array(
'form' => NULL,
),
'template' => 'node-gstcourse-edit',
'render element' => 'elements',
'preprocess functions' => array('template_preprocess','template_preprocess_node'),
);
And that *partially* worked (it had errors in the page because of some missing variables, and it just didnt' seem right that I was supposed to populate the "preprocess functions" array since no one else was ever doing that in any of the examples I found).
So, I scrapped that and tried this:
<?php
function gstmain_preprocess_page(&$vars, $hook) {
if (isset($vars['node'])) {
// If the node type is "blog" the template suggestion will be "page--blog.tpl.php".
$vars['theme_hook_suggestions'][] = 'page__'. str_replace('_', '--', $vars['node']->type);