I want to theme the template for edit or add a node for a specific content type.
For example, to theme all the content type forms I use the file page-node-{add|edit}.tpl.php
(depending what I need to do add or edit).
But I didn't found the template name for a custom node type, for example Products.
I need to theme only for Products, but not for the other content types.
I've tried with page-node-edit-product.tpl.php
and page-node-product-edit.tpl.php
but no luck.
I put this in my template.php file in my theme's directory:
For me the same problem. Prompt where to insert a code:
It is entered in template.php or in page-node - {add|edit}-example.tpl.php?
This is what I think is the 'proper' way to do it.
From the node module:
So Drupal will try to theme 'product_node_form'
so you can create a module which implements this.
You will need to implement [hook_theme][1], and provide a function or template.
You may find that it is easier to use [hook_form_alter][2] to add some classes and normal CSS to change the appearance.
Add the above code in template.php
Then create couple of tpl files
1) page-contenttype.tpl.php
used when displaying and editing the content
2) page-node-add-contenttype.tpl.php
used when adding that content type.
Works with drupal 6.
Hmm. There may be a better way but what about a preprocess function.
I'm still really new to Drupal, so I would maybe try something like this [code may not work]:
Be sure to clear cache and theme registry after making new preprocess functions.
I'm a drupal noob myself, but would something (might need a little more) like this work?