2013-07-14 1 views
0

안녕하세요, drupal 7 테마에 대한 새 변수를 만들려고합니다. 내 테마 이름은 ntheme입니다.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에 :이를 위해 나는 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() ( C : \ Wamp \ www \ drupal \ sites \ all \ themes \ ntheme \ templates \ comment-wrapper.tpl.php의 39 행).

뭐하는거야?

답변

0

ur 테마 이름이 ntheme 인 경우 테마 이름이 ntheme_gnu 또는 ntheme입니다. hook_preprocess를 ntheme_preprocess()로 호출해야합니다.