こんにちは、drupal 7 テーマ用の新しい変数を作成しようとしています。私のテーマ名はntheme
. このために、次の関数を定義しましたtemplate.php
。
function ntheme_gnu_preprocess(&$variables)
{
$variables['disclaimer'] = t('Comments are unaythorized. The views expressed are those of the comment author.');
}
そして、この変数$disclaimer
を次のように使用しました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>
しかし、それは通知を示しています:
注意: 未定義の変数: include() の免責事項 (C:\wamp\www\drupal\sites\all\themes\ntheme\templates\comment-wrapper.tpl.php の 39 行目)。
私は何をしているのですか?