如何更改块视图分页样式
我之前在 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;
}
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以将一些东西与一堆主题覆盖函数一起捏造,但实际上没有必要:你可以只使用好的'ol CSS。
只需创建这样的规则:
这将仅针对块内的寻呼机,删除
下一个
和上一个
文本并在其位置添加您的图像:)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:
That will target just pagers that are inside a block, removing the
next
andprevious
text and adding your image in their place :)