doudilin1225 2011-09-27 16:09
浏览 24
已采纳

如何更改块视图分页样式

I previously posted this question on drupal stackoverflow, but I didn't get any answers. I'm trying to make 2 different pagination styles. One for page views, and the other for block views. The block view should display image arrows for previous and next. I tried the following, but it changes both styles

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条回答 默认 最新

  • douhuan1648 2011-09-27 17:59
    关注

    You could fudge something together with a bunch of theme override functions but really there's no need: you can just use good 'ol CSS.

    Just create rules like this:

    .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;}
    

    That will target just pagers that are inside a block, removing the next and previous text and adding your image in their place :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)