欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

评论 comment的建议模板 有大用 有大大用


在模板的 template.php文件中,如下的hooke函数可以看到建议模板 



function bartik_clone_preprocess_comment_wrapper(&$variables) {
  // Provide contextual information.
  $variables['node'] = $variables['content']['#node'];
  $variables['display_mode'] = variable_get('comment_default_mode_' . $variables['node']->type, COMMENT_MODE_THREADED);
  // The comment form is optional and may not exist.
  $variables['content'] += array('comment_form' => array());

  $node = $variables['node'];
  if($node->type=='question_answer'){
    $variables['theme_hook_suggestions'][] = 'comment_wrapper_question_answer';
  }
  $e = kprint_r($variables,TRUE);
  print $e;
}



应该是  theme_hook_original,theme_hook_suggestion 起作用 ,,反而theme_hook_suggestions 不起作用


image.png

普通分类: