2013-05-14 110 views
0

您好我想添加html到“t('旧帖子')”和“t('新帖子')”这可能吗?我可以弄明白吗? 我在一个Drupal 6 template.php文件中。添加HTML到T()在Drupal 6 template.php?

这是我想添加为HTML代码 -

<a href="" class="action"><span>Newer Posts</span></a> 
<a href="" class="action back"><span>Older Posts</span></a> 

我需要更换上述这些斑点位于下方的全功能?

t('Older Posts') 
t('Newer Posts') 

我想这样

t('<a href="" class="action back"><span>Older Posts</span></a>') 
t('<a href="" class="action"><span>Newer Posts</span></a>') 

全功能

function theme_views_mini_pager($tags = array(), $limit = 10, 
$element = 0, $parameters = array(), $quantity = 9) {  
global $pager_page_array, $pager_total; 

// Calculate various markers within this pager piece: 
// Middle is used to "center" pages around the current page. 
$pager_middle = ceil($quantity/2); 
// current is the page we are currently paged to 
$pager_current = $pager_page_array[$element] + 1; 
// max is the maximum page number 
$pager_max = $pager_total[$element]; 
// End of marker calculations. 


$li_previous = theme('pager_previous', (isset($tags[1]) ? $tags[1] : 
t('Older Posts')), $limit, $element, 1, $parameters); 
if (empty($li_previous)) { 
$li_previous = "&nbsp;"; 
} 

$li_next = theme('pager_next', (isset($tags[3]) ? $tags[3] : t('Newer Posts')), 
$limit,$element, 1, $parameters); 
if (empty($li_next)) { 
$li_next = "&nbsp;"; 
} 

if ($pager_total[$element] > 5) { 
$items[] = array(
    'class' => 'action back pager-previous', 
    'data' => $li_previous, 
); 

$items[] = array(
    'class' => 'action pager-next', 
    'data' => $li_next, 
); 
return theme('item_list', $items, NULL, 'ul', array('class' => 'pager')); 
} 
} 

我试图找出创造的东西,如果这是可能的话我已经尝试了许多东西,什么都还没有工作。

+0

这个问题是关系到** HTTP://drupal.stackexchange.com/** – mate64 2013-05-17 15:53:34

回答

0

您可以使用

$link = '<a href="" class="action back"><span>' . t('Older Posts') . '</span></a>'; 

OR

$link = t('!link_startOlder Posts!link_end', array(
    '!link_start' => '<a href="" class="action back"><span>', 
    '!link_end' => '</span></a>', 
));