views:

2272

answers:

4

In my template.php file I've this:

function myadmintheme_theme(&$existing, $type, $theme, $path) {
  return array(
    'node_form' => array(
     'arguments' => array('form' => NULL),
     'template' => 'ccktype',
    ),
  );
}

And I've a ccktype.tpl.php in the same dir:

<b>works!</b>

But is not working, if I enter to node/add/ccktype I don't get the "works!" message.. I tried everything!

any help would be appreciated

A: 

First of all, see that Drupal's not caching your module. Go to Administer > Site Configuration > Performance, and clear all caches.

If that doesn't work, try renaming the file to node-add-ccktype.tpl.php.

Seb
thanks, but is not work... it's strange, isn't it?
br1
Yeah, I really don't know... I had problems with that theme hook as well. Sorry I can't help anymore :(
Seb
+5  A: 

The theme function you need to override is ccktype_node_form, not node_form. All node forms maintained by the node module get mapped to the node_form function for building, but they still have unique form ids.

Eaton
I tried that also, but didn't work. I forgot to say that in the "Administration theme" y check "Use administration theme for content editing" (that is obvious).
br1
hey, I didn't notice this, but there is a very little change in the style when I use ccktype_node_form :DIt is not printing "WORKS!", but is better than nothing ;D
br1
hey, now works! I love you!!! xD
br1
+1  A: 

This is the solution:

function myadmintheme_theme($existing, $type, $theme, $path) {
  return array(
    'ccktype_node_form' => array(
     'arguments' => array('form' => NULL),
     'template' => 'ccktype',
    ),
  );
}

thanks a lot Eaton!

br1
Glad you solved this! If Eaton helped you, then please mark his answer as correct; that will help others find this problem is solved and will grant Eaton reputation points for having helped. :)
Seb
A: 

Thanks so much for this! I spent a ton of time looking on the stupid Drupal site and tried about 20 things that didn't work.

Ugh!