1

I themed page to create custom type node and named it page--node--add--book.tpl.php It works well, but when I tried to theme content edit page and named it page--node--edit--book.tpl.php nothing happening. Help to fix this.

Tried suggestions:

function bookhive_theme() {
  return array(
    'book_node_form' => array(
        'arguments' => array('form' => NULL),
        'template' => 'book-node-form',
        'render element' => 'form',
    ),
  );
}

and suggestion from here

http://www.wdtutorials.com/how-to-override-forms-using-custom-template-drupal-tutorial/7
2
2

Ok, I find an answer. In my case the proper theme suggestion was html--node--edit.tpl.php I used theme debug mode to find it.

Also, to make page--node--edit.tpl.php works I need to delete my page--contenttype.tpl.php file. To customize my content type page I just used simple check in page.tpl.php if($node->type == 'book'):

<!-- THEME DEBUG -->
<!-- CALL: theme('html') -->
<!-- FILE NAME SUGGESTIONS:
   * html--node--edit.tpl.php
   * html--node--209.tpl.php
   * html--node--%.tpl.php
   * html--node.tpl.php
   x html.tpl.php
-->
1

page--node--edit--book.tpl.php isn't a valid theme template suggestion. From the d.o. D7 Template docs for page.tpl.php...

The list of suggested template files is in order of specificity based on internal paths. One suggestion is made for every element of the current path, though numeric elements are not carried to subsequent suggestions. For example, "http://www.example.com/node/1/edit" would result in the following suggestions:

  1. page--node--edit.tpl.php
  2. page--node--1.tpl.php
  3. page--node.tpl.php
  4. page.tpl.php

If you're looking to theme a node edit page, use page--node--edit.tpl.php.

5
  • oh, I tried page--node--edit.tpl.php but, thats not work too. at least for me. – Oleg Vdovenko Sep 17 '15 at 7:52
  • Two things to note why it might not work: You need to clear the Drupal cache / You're using the administration theme for page editing (i.e. the Use the administration theme when editing or creating content on theme administration page). – Shawn Conn Sep 17 '15 at 18:56
  • I use Devel to rebuild theme registry on every page reload, I cleared cache manually few times and I check this from regular user account. – Oleg Vdovenko Sep 18 '15 at 7:47
  • page--node--edit.tpl.php works only with page like website.com/node/edit but not with node/1/edit – Oleg Vdovenko Sep 18 '15 at 8:51
  • website.com/node/edit would not be a valid path in Drupal. – Shawn Conn Sep 18 '15 at 22:52

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.