2013-07-14 1 views
0

Привет Я пытаюсь создать новую переменную для темы drupal 7. Имя моей темы: ntheme. Для этого я определил функцию в template.php:Создание новой переменной для темы drupal 7 с сообщением об ошибке

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> 

Но это показывает Примечание:

Примечание: Undefined переменной: отказ от ответственности в include() (строка 39 из C: \ wamp \ www \ drupal \ sites \ all \ themes \ ntheme \ templates \ comment-wrapper.tpl.php).

Что я не делаю?

ответ

0

Является ли имя вашей темы ntheme_gnu или ntheme beacuse если ур имя тема ntheme и должны вызывать hook_preprocess как ntheme_preprocess()

Смежные вопросы