mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
ENHANCEMENT: Allow configuration of the default number of entries to show on lists
This commit is contained in:
parent
6d0f161cf4
commit
6eebbb217c
@ -10,6 +10,9 @@
|
|||||||
|
|
||||||
class BlogTree extends Page {
|
class BlogTree extends Page {
|
||||||
|
|
||||||
|
// Default number of blog entries to show
|
||||||
|
static $default_entries_limit = 10;
|
||||||
|
|
||||||
static $db = array(
|
static $db = array(
|
||||||
'Name' => 'Varchar',
|
'Name' => 'Varchar',
|
||||||
'InheritSideBar' => 'Boolean',
|
'InheritSideBar' => 'Boolean',
|
||||||
@ -242,7 +245,9 @@ class BlogTree_Controller extends Page_Controller {
|
|||||||
Requirements::themedCSS("blog");
|
Requirements::themedCSS("blog");
|
||||||
}
|
}
|
||||||
|
|
||||||
function BlogEntries($limit = 10) {
|
function BlogEntries($limit = null) {
|
||||||
|
if ($limit === null) $limit = BlogTree::$default_entries_limit;
|
||||||
|
|
||||||
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
|
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
|
||||||
return $this->Entries("$start,$limit", BlogURL::tag(), BlogURL::date());
|
return $this->Entries("$start,$limit", BlogURL::tag(), BlogURL::date());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user