如何更改块视图分页样式

时间:2011-09-27 16:09:52

标签: php drupal drupal-7 drupal-theming

我之前在drupal stackoverflow上发布了这个问题,但我没有得到任何答案。 我正在尝试制作两种不同的分页风格。一个用于页面视图,另一个用于块视图。块视图应显示上一个和下一个的图像箭头。我尝试了以下方法,但它改变了两种风格

function theme_pager_first($variables) {
  $text = $variables['text'];
  $text = "test123";
  $element = $variables['element'];
  $parameters = $variables['parameters'];
  global $pager_page_array;
  $output = '';

 // If we are anywhere but the first page
 if ($pager_page_array[$element] > 0) {
    $output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array(0, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters));
  }

  return $output;
} 

1 个答案:

答案 0 :(得分:2)

可以与一堆主题覆盖功能一起捏造某些东西,但实际上没有必要:你可以使用好的'ol CSS。

只需创建如下规则:

.block .pager-first a{display:inline-block;text-indent:-999em;background:url(/path/to/arrow.jpg) left top no-repeat;}
.block .pager-last a{display:inline-block;text-indent:-999em;background:url(/path/to/arrow.jpg) right top no-repeat;}

这将仅定位到块内的寻呼机,移除nextprevious文本并在其位置添加图像:)

相关问题