簡體   English   中英

如何使用評論包裝器在drupal 7中的子主題中更改特定節點類型的評論標題-<content-type> .tpl.php

[英]how to change comment header in particular node type in sub theme in drupal 7 using comment-wrapper-<content-type>.tpl.php

嗨,我是 Drupal 開發的新手。 我正在嘗試更改文章內容的評論部分。 我的要求是我想改變標題[注釋科] 1添加新的評論,以增加新的審查提出意見以前的評論,且我的分專題評論對象,它使用bartik作為基本主題。

誰能幫我。 這是我在子主題中的 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; ?>
?>

最后我成功找到了問題的解決方案,以防萬一有人面臨同樣的問題。這是解決方案。

<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>

主要要求是文件名應采用以下格式。“comment-wrapper--node-contenttype.tpl.php”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM