0

I wanted to have a special template for all my node/add forms, in my Drupal 6 installation.

So, I´ve added this code to a little module:

function modding_preprocess_page(&$vars, $hook) {
  if ((arg(0) == 'node') && (arg(1) == 'add')) {
    $vars['template_files'][] =  'node-add';
  }
} 

My node-add.tpl.php template looks like this:

<h1><?php print $title ?></h1>
<?php print $content ?>

The thing is that all styling has gone.

The style sheets won´t load, and I don´t understand why. It looks as ugly as it can get when no style whatsoever is loaded.

I may add that I´ve cleared cache more than once, and as this is a testing site, all performance caching has been disabled.

Thanks for your help!!

1 Answer 1

1

I´ve found the solution:

<?php 
      if ((arg(0) == 'node') && (arg(1) == 'add') || (arg(2) == 'edit')){
    $node = node_load(array('nid' => arg(1)));
    print $title;
    }
?>

Thanks to nevets, who gave me the hint that I needed! :)

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.