1

This is in Drupal 6.

How to make a content edit form be in a specified theme?

The administration theme is 'seven', and use admin theme for content edit. Site configuration: /admin/settings/admin Administration theme: Seven [x] Use administration theme for content edit

Create a new content type 'example'.

In the module, this function makes 'example' edit form in example_node_form.tpl.php template. But this template will be in 'seven' theme, themes/seven/example_node_form.tpl.php

function modulename_theme() {
  return array(
    'example_node_form' => array(
    'template' => 'example-node-form',
    'render element' => 'form',
    ),
  );
}

Want 'example' edit form in another theme, not 'seven' theme?

How to make a content edit form be in a specified theme?

0

Implement hook_form_alter in custom module and check for current theme :

global $theme;
function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'example_node_form_id' && $theme != 'theme_machine_name') {
    // redirect anywhere using drupal_goto.
  }
}
| improve this answer | |

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.