2013-07-14 24 views
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)。

我在做什麼錯?

回答

0

是您的主題名稱ntheme_gnu或ntheme怎麼一回事,因爲如果烏拉圭回合主題名稱是nthemeü應該叫hook_preprocess爲ntheme_preprocess()