By yangke on
I created a node type module. Now i want to theme the edit form of this new content type.
I added this hook_theme to my template.php:
<?php
/**
* Implementation of HOOK_theme(). To make more forms themable, add them to the array.
*/
function mytheme_theme(){ //mytheme is the name of the theme i'm using (a zen subtheme)
return array(
'sheet_node_form' => array( // i want to theme the sheet_node_form (sheet is a node module)
'arguments' => array('form' => NULL),
'template' => 'node-sheet-edit',
),
'error_node_form' => array( // i already themed the error_node_form (error is a CCK content type)
'arguments' => array('form' => NULL),
'template' => 'node-error-edit',
),
);
}
?>
I have node-sheet-edit.tpl.php and node-error-edit.tpl.php in my mytheme folder.
I emptied the cache.
However both the error content types and the sheet content types are using the same template file (the one from error).
I tried switching orders in the array, but it's still using the error template
I think it's a syntax thing, but i don't see it.
-------
Here's the node-sheet-edit.tpl.php
<?php
/* assign the buttons to a variable, otherwise they get lost */
$buttons = drupal_render($form['buttons']);
/* some very good information is available at http://drupal.org/node/601646 */
print("SHEET FORM: Adjust the layout of this form using node-sheet-edit.tpl.php in the philipstheme folder");
print drupal_render($form);
/* place the buttons at the bottom */
print $buttons;
?>
This has to be edited ofcourse. The node-edit-edit.tpl.php is the same but it prints ERROR FORM: blablabla..