0
您好我正在嘗試爲drupal 7主題製作一個新變量。我的主題名字是ntheme
。在comment-wrapper.tpl.php
爲drupal 7主題製作新變量顯示錯誤提示
function ntheme_gnu_preprocess(&$variables)
{
$variables['disclaimer'] = t('Comments are unaythorized. The views expressed are those of the comment author.');
}
而且使用這個變量$disclaimer
:對於這個我已經在template.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>
但它顯示的通知:
注意:未定義的變量:免責聲明include()(第39行: C:\ wamp \ www \ drupal \ sites \ all \ themes \ ntheme \ templates \ comment-wrapper.tpl.php)。
我在做什麼錯?