2017-02-08 5 views
0

안녕하세요 저는 Drupal Development가 처음입니다. 기사 내용의 주석 섹션을 변경하려고합니다. 내 요구 사항은 내가 새로운 검토 및 의견이전 리뷰주제검토 대상를 추가 에에 새 코멘트를 추가 에서 1 [코멘트 섹션]의 헤더를 변경하려면 내 기본 테마로 바틱을 사용하는 하위 테마.comment-wrapper- <content-type> .tpl.php를 사용하여 drupal 7의 하위 테마에서 특정 노드 유형의 주석 헤더를 변경하는 방법

아무도 도와 줄 수 있습니까? 다음은 sub-theme에서 comment-wrapper-article.tpl.php에서 변경 한 코드입니다.하지만 디스플레이를 변경할 수는 없습니다.

<?php 
<div id="comments" class="<?php print $classes; ?>"<?php print $attributes; ?>> 
<?php if ($node->type == 'article'): && $node->type == 'article');?> 
<?php print render($title_prefix); ?> 
<h2 class="title"><?php print t('previous Reviews'); ?></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 Review'); ?></h2> 
<?php print render($content['comment_form']); ?> 
<?php endif; ?> 
?> 
+0

작은 제안 :. 가까운 많은/열리지 않습니다 PHP 태그를 사용하는 대신 한 번 열어 모든 출력을 변수에 저장 한 다음 한 번 에코합니다. 이렇게하면 코드에서 문제를 찾을 수 있습니다. – Peon

+0

@DainisAbols 팁을 주셔서 감사하지만 코어 템플릿 코드도 여러 PHP 태그와 비슷한 종류로되어 있습니다. – miststudent2011

답변

0

마지막으로 나는 문제가있는 경우 문제를 해결하는 데 성공했습니다. 여기에 해결책이 있습니다.

<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('Previous Reviews'); ?></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 Review'); ?></h2> 
<?php print render($content['comment_form']); ?> 
<?php endif; ?> 
</div> 

주요 요구 사항은 파일 이름은 다음 형식이어야이다 "코멘트 - 래퍼 - 노드 contenttype.tpl.php"