如何在Drupal View中设置每页的项目数?

时间:2011-12-04 12:31:18

标签: drupal pagination drupal-7 drupal-views

我遇到一个问题,我的视图会在视图的第一页上显示特色项目和6行,而在其余页面上显示9行。视图是否可以实现此功能?

谢谢!

1 个答案:

答案 0 :(得分:0)

我能想到的一些方法。我根据你需要多长时间来提及它们。

1)创建一个自定义css规则,在第一页上隐藏两个条目。至于其他页面,您可以显示它。

2)找到特定视图的模板文件,然后使用php隐藏这些行。您可以在视图主题部分中找到此文件的名称。

3)你可以编写一个可以和视图一样的php模块。要做到这一点并不难。

<强>更新

下面是jquery,它将帮助您获得正确的逻辑

$(document).ready(function() {
var pathname = window.location.pathname;

// here we assignt he current url of the page to the var pathname
});

if(pathname =='firstPageofView')
{
// if the path name is the first page of the view then we assign special css formating
$('#divid').hide(); 

}
else
{

$('#divid').css('width','10px');    
}

干杯, 维沙尔