I am trying to make a new variable for a theme whose name is ntheme. I have defined the following function in template.php.
function ntheme_gnu_preprocess(&$variables) {
$variables['disclaimer'] = t('Comments are unaythorized. The views expressed are those of the comment author.');
}
I used $disclaimer
in the comment-wrapper.tpl.php template file.
<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>
I get the following warning.
Notice: Undefined variable: disclaimer in include() (line 39 of C:\wamp\www\drupal\sites\all\themes\ntheme\templates\comment-wrapper.tpl.php).
What am I doing wrong?
ntheme
then usentheme_preprocess
ntheme_preprocess_page