使用pi_list_browseresults()在typo3中进行页面浏览

时间:2013-02-28 08:23:55

标签: typo3

我想设置浏览结果页面的链接数量   用kickstarter创建的扩展名。 (Page1 Page2 Page3 ......)。

可以轻松设置最大数量(在本例中为4):

**$this->internal["maxPages"]=t3lib_div::intInRange($lConf["maxPages"],0,1000,4); **

但无论如何,这将始终显示前四个链接  我是哪一页所以说我有7个结果页面,我已经在页面上了  四:我看到“Page1 Page2 Page3 Page4”。

是否有可能改变  这是动态的。

所以在第4页,我看到了“Page2 Page 3 Page4 Page5”

在第5页,我看到“Page 3 Page4 Page5 Page6”  等等?

2 个答案:

答案 0 :(得分:1)

我认为你在寻找的是:

$this->internal['pagefloat']

它的定义如下:

Using $this->internal['pagefloat']: this defines were the current page is shown in the 
list of pages in the Pagebrowser. If this var is an integer it will be interpreted as   
position in the list of pages. If its value is the keyword "center" the current page will 
be shown in the middle of the pagelist.

您可以在函数pi_list_browseresults(类tslib_pibase)的doc标头中找到更多选项和说明: 第425行,http://doxygen.frozenkiwi.com/typo3/html/de/d1c/class_8tslib__pibase_8php_source.html

答案 1 :(得分:0)

点击此链接:http://www.typo3forum.net/forum/extension-modifizieren-neu-erstellen/55721-fe-userlisting.html。 用户已经使用了已成功实现分页的代码,例如:

............

 $this->internal['results_at_a_time'] = t3lib_utility_Math::forceIntegerInRange($lConf['results_at_a_time'], 0, 1000, 3); // Number of results to show in a listing.
 $this->internal['maxPages'] = t3lib_utility_Math::forceIntegerInRange($lConf['maxPages'], 0, 1000, 2); // The maximum number of "pages" in the browse-box: "Page 1", 'Page 2', etc.

...........

相关问题