Hi, I searched on forums and google, and fight with this for a long time.... still no luck. So any help greatly appreciated.
I defined a content-type ("nony") from the backend and was able to modify the themeing of the form from a module with the following code:
nony.module:
function nony_theme($existing, $type, $theme, $path) {
return = array(
'nony_node_form' => array(
'render element' => 'form',
'path' => drupal_get_path('module', 'nony'),
'template' => 'nony-node-form'
),
'nony_node' => array(
'render element' => 'form',
'path' => drupal_get_path('module', 'nony'),
'template' => 'nony-node-view'
)
);
}
function template_preprocess_nony_node_form(&$variables) {
drupal_add_js(drupal_get_path('module', 'nony') . '/nony.js', 'file');
}
function template_preprocess_nony_node_view(&$variables) {
kpr($variables);
}
Then I got two files with the templates:
promise-node-form.tpl.php
promise-node-view.tpl.php
If I add or edit a "nony" node template_preprocess_nony_node_form gets called, the nony.js loaded, and the promise-node-form.tpl.php is rendered fine.
The problem is when I want to view a "nony" node, I can't get template_preprocess_nony_node_view function called, or even the view template rendered.