why the overwrite doesn't have the output?
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.
- First make sure that
function mytheme_preprocess_rate_template_emotion(&$variables)
is getting called by putting a dpm(install devel module) in the function. - And inside
function rate_preprocess_rate_template_emotion(&$variables)
they are usingforeach ($links as $link)
. So make sure that whether you want to do it for all links are just one link. - 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.
精彩评论