开发者

why the overwrite doesn't have the output?

开发者 https://www.devze.com 2023-02-23 07:05 出处:网络
function rate_preprocess_rate_template_emotion(&$variables) { extract($variables); $buttons = array();
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();
........

now i want to add <br/><开发者_如何转开发;span class="pollunm">around the </span>. i put this code in my theme template.php.but it doesn't output the span tags.

function mytheme_preprocess_rate_template_emotion(&$variables) {
$link['votes']='<br/><span class="pollunm">'.$link['votes'].' </span>';
}


This is not a solution. Just the step for you to debug.

  1. First make sure that function mytheme_preprocess_rate_template_emotion(&$variables) is getting called by putting a dpm(install devel module) in the function.
  2. And inside function rate_preprocess_rate_template_emotion(&$variables) they are using foreach ($links as $link). So make sure that whether you want to do it for all links are just one link.
  3. Within function mytheme_preprocess_rate_template_emotion(&$variables) put a dpm($variables); and find out which are the variables available to you and what are their values. It might help you.
0

精彩评论

暂无评论...
验证码 换一张
取 消