3

How I can customize the node edit page? I need to use a custom template for it. page--node--add-content-type.tpl.php works fine, but --edit--content-type.tpl.php doesn't.

3

You need to use function hook_preprocess_HOOK.

function themeName_preprocess_page(&$vars) {
    if (!empty($vars['node']) && arg(2) == 'edit') {
    $vars['theme_hook_suggestions'][] = 'page__node__' . $vars['node']->type .'__edit';
  }
}

This allowed me to use: page--node--[contentType]--edit.tpl.php

Clear cache.

1

I figured it now.

function HOOK_preprocess_page(&$variables) {
    if (isset($variables['node']->type)) {
        $nodetype = $variables['node']->type;
        $variables['theme_hook_suggestions'][] = 'page__' . $nodetype;
    }
    if (!empty($variables['node']) && arg(2) == 'edit') {
        $variables['theme_hook_suggestions'][] = 'page__node__' . $variables['node']->type .'__edit';
  }
}

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.