0

Hi I am trying to add html to the "t('Older Posts')" and "t('Newer Posts')" Is this possible ? I can figure it out ???? I am in a Drupal 6 template.php file.

This is the code I am trying to add as html -

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

I need to replace the above in these spots located in the full function below ?

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

I want to create something like this

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

Full Function

 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'));
}
}

I am trying to figure out if this is possible I have tried many things and nothing has worked yet.

1

2 Answers 2

2

You should probably look into overriding the pager theme functions instead.

0

I would do it more like this:

$html = '<a href="" class="action back"><span>';
$html .= t('Older Posts');
$html .= '</span></a>';
1
  • yeah that still output plain text I wanted it to change the output of the views pager and still encode as html in the browser not plain text sorry that may have been unclear
    – naeluh
    May 14, 2013 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.