Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Post limit option

givanzebace57cf3b0
diff --git a/app/component/categories/pages.php b/app/component/categories/pages.php
index bb7a9ec..4efd8e6 100755
--- a/app/component/categories/pages.php
+++ b/app/component/categories/pages.php
@@ -30,13 +30,13 @@ class Pages extends ComponentBase {
public static $defaultOptions = [
'start' => 0,
'limit' => 7,
+ 'posts_start' => 0,
+ 'posts_limit' => NULL,
'site_id' => NULL,
'order' => ['url', 'price asc'],
'taxonomy_item_id' => NULL,
'page' => 1,
- 'parents_only' => false,
- 'parents_children_only' => false,
- 'parents_without_children' => false,
+ 'parent_id' => false,
];
function results() {
@@ -57,6 +57,10 @@ class Pages extends ComponentBase {
$category['post'] = json_decode($category['post'], true);
if (is_array($category['post'])) {
+ if (isset($this->options['posts_limit'])) {
+ $category['post'] = array_slice($category['post'], 0 , $this->options['posts_limit']);
+ }
+
$category['posts_count'] = count($category['post']);
}
}