Hi,

Normally, with drupal 6, I should be able to theme a node_type creation form by creating a node_type-node-form.tpl.php file.

It works for a global node-form.tpl.php, but don't work with story-node-form.tpl.php for example.

It is a knows bug in the zen beta that explain this problem ?

regards,

zmove

Comments

zmove’s picture

Hi,

I have news about my problem, it seems that ou have to declare the function in hook_theme before beeing able to use it. see : http://drupalbin.com/1908

The problem is that zen subtheme already have a zen_theme() function, so I don't know how to do that... I would modify the template.php in the zen master theme, but I would prefer not hacking zen core...

How can I do that please ?

johnalbin’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm.. Ok. You can still modify the _theme() function in you subtheme. This might work:

function STARTERKIT_theme(&$existing, $type, $theme, $path) {
  $hooks = zen_theme($existing, $type, $theme, $path);
  $hooks['page_node_form'] = array(
    'arguments' => array('form' => NULL),
  );
  return $hooks;
}

function STARTERKIT_page_node_form() { … }

Try that and let me know if it works. Then I can modify the STARTERKIT to make this easier for people in the future.

zmove’s picture

Hi,

I tried to put your code like that :

function my_theme_theme(&$existing, $type, $theme, $path) {
  $hooks = zen_theme($existing, $type, $theme, $path);
  $hooks['recipe_node_form'] = array(
    'arguments' => array('form' => NULL),
  );
  return $hooks;
}

It bring me an error when I want to edit my node of type : recipe

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'my_theme_recipe_node_form' was given in \drupal6\includes\theme.inc on line 591.

Any ideas how to fix it ?

johnalbin’s picture

niklp’s picture

So is this fixed...?

zmove’s picture

Forget it, I miss the function STARTERKIT_page_node_form() { … }

So it mean that it's not possible to theme a form in a .tpl.php file ? you have to define it in the function above ?

johnalbin’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Closed (fixed)

zmove

Uh, no, you can't define functions in .tpl.php files. They should go in your template.php.

This issue doesn't sound like a Zen-related bug. And (if you couldn't already tell from how long it took for you to get a response in this issue queue), I think the best place to get support for this would be in IRC. As I don't know much about form theming.