1

I would like to override the template for node creation. In the past when I've overridden a template, I've usually just copied the theme's generic template for that type (page, node, etc), given it the proper name, and edited it as I saw fit.

Now, for the first time I need to override a template that I can't simply make a copy of. I'm editing the node editing template and I have created a file with the correct name and location and everything, and it overrides the edit form, all right. Now there's nothing on the page except what's in my new template (unsurprisingly).

So, how do I create a template without getting rid of what was already there? Or, where can I find the template that Drupal is using to create my node edit form?

I'm using Drupal 7 and the theme is a custom one written by the previous maintainer of the site. It's not a child theme of a base theme, it's all by its lonesome.

  • 1
    as node creation/edition pages are coming from drupal_get_form I'm wondering how you change their template using .tpl file without any module! – Mohammad Ali Akbari Aug 23 '12 at 20:29
2

Because the Node Edit page is a form, it is recommended that you use hooks for theming it. You can create custom template file for it, but theming it within template.php is the most common solution.

Theming Node Forms in Drupal 7 is the best resource I've seen so far for this.

  • I've used that tutorial but I had no results. Maybe I wasn't naming things quite right? I'll post my steps. – beth Aug 23 '12 at 20:54
  • Never mind, in going back to my code to paste it, I found some errors, and fixed them, and it totally works. Thanks, man! – beth Aug 23 '12 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.