Question

I'm trying to create a template file for the node add or edit screens, I can override the normal node load by using node--contenttype.tpl.php but does anyone know how to go about doing it for edit or add? and this is for Drupal 7 not 6.

thanks

Was it helpful?

Solution

It really depends on what are you overriding the template for, but I'd suggest you either use page--node--edit.tpl.php - which will be called on every node editing page of your site (ie. is not content-type specific) - or add a condition in your node--contenttype.tpl.php using the arg() function:

if (arg(2) == 'edit') {

  // your overriding code here

}

You should also be aware that this will work only if you are using your custom theme in the node editing page, which is not the default behavior in the default drupal installation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top