0

Hi I am trying to make a new variable for drupal 7 theme. My theme name is ntheme. For this I have defined a function in template.php :

function ntheme_gnu_preprocess(&$variables)
{
    $variables['disclaimer'] = t('Comments are unaythorized. The views expressed are those of the comment author.');
}

And used this variable $disclaimer in comment-wrapper.tpl.php:

<div id="comments" class="<?php print $classes; ?>"<?php print $attributes; ?>>
  <?php if ($content['comments'] && $node->type != 'forum'): ?>
    <?php print render($title_prefix); ?>
    <h2 class="title"><?php print t('Comments'); ?></h2>
    <?php print render($title_suffix); ?>
  <?php endif; ?>

  <?php print render($content['comments']); ?>

  <?php if ($content['comment_form']): ?>
    <h2 class="title comment-form"><?php print t('Add new comment'); ?></h2>
    <?php print render($content['comment_form']); ?>
  <?php endif; ?>
  <p><?php print $disclaimer; ?></p>
</div>

But it showing Notice :

Notice: Undefined variable: disclaimer in include() (line 39 of C:\wamp\www\drupal\sites\all\themes\ntheme\templates\comment-wrapper.tpl.php).

Whats wrong I am doing ?

user2535137
  • 3
  • 1
  • 4

1 Answers1

0

Is your theme name ntheme_gnu or ntheme beacuse if ur theme name is ntheme u should call the hook_preprocess as ntheme_preprocess()