I need to theme the edit page for ONLY article node type
GIVEN you have a node type of "article"
AND you want the node type to have its own edit template
WHEN you add/edit a node type of "article"
THEN the custom node type (edit "edit article") template is used.
The following works in Drupal 7
Name the file whatever you want. For the sake being simplistic, we will name it "article--edit.tpl.php"
Place that article--edit.tpl.php file in your theme directory where your other tpl files are.
WHY DO THIS?
There is no template suggestion for a specific node edit form. You can do a global edit form page such as is in the documentation on Drupal "page--edit.tpl.php but this is not specific to one node type. So, you need to create a tpl file with the name you desire to be used for the "article edit" page. We edit the template.php file so that your site knows to use this new tpl file you created when editing any article node type.
The following code is to be used in your template.php file. If you don't have one then create it.
array( 'arguments' => array( 'form' => NULL, ), 'template' => 'templates/article--edit', // this must be the name of the file you created. Our file was title "article--edit.tpl.php" so we use article--edit 'render element' => 'form', ), ); } ?>
If you miss this step then this will will not work.
Use the following so that your edit page has content. The "themeing" is up to you.
The I Heart Technology Blog is written by our team members at Nyberg Technology and NyTechEd.
We hope to educate and support the community through providing resources and premium software development.
Are you a developer? Are you a tech blogger? We would love to hear from you!