0

I got the following to work by adding it to the admin template.php file. But I am not having any luck changing the one edit form to use boostrap_subtheme vs the default admin theme. Any advice with that? To add a little more to this, I am using the following code to set the add node for data set to the default theme, how would you do this for a node edit page? The url for the node edit page contains the node id.

function mymodule_menu_alter(&$items){ $items['node/add/data-set']['theme callback'] = 'mm_get_default_theme';

}

function mm_get_default_theme(){ return variable_get('theme_default', '0'); }

I am using the hook_theme() function to override the theme for a given node's edit form. This works when you create a new node but does not override the theme with the use clicks "edit". Any ideas? Path of the edit form is for instance node/39/edit.

$items['custom_node_form'] = array(
  'arguments' => array('form' => NULL),
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'bootstrap_subtheme') . '/templates',
  'template' => 'custom-node-form',    
);

1 Answer 1

0

Its working on my site, although i haven't made a template but it should work with a template too. here is my code

function modulename_theme(){
     $items['article_node_form'] = array(
    'arguments' => array('form' => NULL),
    'render element' => 'form',
  );
    return $items;
}
function theme_article_node_form(&$var){
    $form=$var['form'];
    $output = '<h2>' . t('Please enter your information below') . '</h2>';
    $output .= drupal_render_children($form);
    return $output;

}
1
  • If I change the admin theme to be bootstrap_subtheme it will work but I only want this one form to be changed to the boostrap them.
    – Russ
    Commented Apr 7, 2014 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.