filtering by categoryKey not showing the paginator

Post Reply
ntsu
Jr. Bludit
Posts: 7
Joined: Sat Aug 24, 2019 3:46 pm

I used the categoryKey to filter the pages inside the category "blog" but the paginator is visible always and does not really work.

Code: Select all

<?php
        $categoryKey = 'blog';
        $category = getCategory($categoryKey);
?>
        <?php foreach ($category->pages() as $pageKey) {
			$page = new Page($pageKey);
			echo "<h1>".$page->title()."</h1>";
			echo "<p>".$page->content()."</p>";
        }
?>
here the paginator

Code: Select all

<?php if (Paginator::numberOfPages()>1): ?>
		<?php if (Paginator::showPrev()): ?>
		<?php echo Paginator::previousPageUrl() ?>
		<?php endif ?>
		<?php if (Paginator::showNext()): ?>
		<?php echo Paginator::nextPageUrl() ?>
		<?php endif ?>
<?php endif ?>
is there a way to solve this? thank you very much.
User avatar
Edi
Site Admin
Posts: 2083
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

ntsu wrote: Sun Mar 08, 2020 1:58 pm I used the categoryKey to filter the pages inside the category "blog" but the paginator is visible always and does not really work.
I do not understand what you mean with 'filter the pages inside the category "blog"'. A category is a sort of filter.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
ntsu
Jr. Bludit
Posts: 7
Joined: Sat Aug 24, 2019 3:46 pm

by filtering i mean, showing only the posts that have the category "blog".

this works fine anyway but it is showing all posts in one page despite the given value at "Items per page" in settings, which is 5 posts per page..
User avatar
Edi
Site Admin
Posts: 2083
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Which theme do you use?
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
ntsu
Jr. Bludit
Posts: 7
Joined: Sat Aug 24, 2019 3:46 pm

Post Reply