Drupal 为什么覆盖没有';你没有输出吗?

Drupal 为什么覆盖没有';你没有输出吗?,drupal,drupal-6,Drupal,Drupal 6,现在我想在周围添加。我把这段代码放在我的主题template.php中,但它不输出span标记 function rate_preprocess_rate_template_emotion(&$variables) { extract($variables); $buttons = array(); foreach ($links as $link) { $button = theme('rate_button', $link['text'], $link['hre

现在我想在
周围添加

。我把这段代码放在我的主题
template.php
中,但它不输出span标记

function rate_preprocess_rate_template_emotion(&$variables) {
  extract($variables);
  $buttons = array();
  foreach ($links as $link) {
    $button = theme('rate_button', $link['text'], $link['href'], 'rate-emotion-btn');
    $button .= $link['votes'];
    $buttons[] = $button;
  }
  $variables['buttons'] = $buttons;

  $info = array();
........
函数mytheme_预处理_速率_模板_情感(&$variables){
$link['voates']='
'.$link['voates'.'; }

这不是一个解决方案。只是调试的步骤

  • 首先,通过在函数中放置dpm(install-devel module),确保调用函数mytheme\u preprocess\u rate\u template\u情感(&$variables)
  • function rate\u preprocess\u rate\u template\u emotion(&$variables)
    内部,他们使用
    foreach($links作为$link)
    。因此,请确保是否要为所有链接执行此操作只是一个链接
  • 在函数mytheme\u preprocess\u rate\u template\u emotion(&$variables)中放置一个dpm($variables);并找出哪些变量对您可用,它们的值是什么。这可能对你有帮助

  • 你的主题叫“神话元素”吗?如果没有,请将“mytheme”更改为主题的名称(主题文件夹中的(.info文件)。你清除了管理员“性能”部分中的缓存数据了吗?是的,主题文件名为mytheme,我已经清除了缓存。mytheme_预处理_速率_模板_情感()真的在速率_预处理_速率_模板_情感()之前调用吗?我不知道,如果它在速率_预处理_速率_模板_情感()之前没有调用在mytheme中如何命名它?
    function mytheme_preprocess_rate_template_emotion(&$variables) {
    $link['votes']='<br/><span class="pollunm">'.$link['votes'].' </span>';
    }