[solved] list posts // all | by tags

kaaleth
Master Bludit
Posts: 112
Joined: Sun Jun 14, 2015 9:55 am
Contact:

Wed Sep 05, 2018 1:12 am

Edi wrote:
Mon Aug 06, 2018 12:56 pm
By the way, you can find the code snippet to list all pages in the documentation:

https://docs.bludit.com/en/developers/content-pages

And the code snippet for all static pages:

https://docs.bludit.com/en/developers/c ... atic-pages
I have checked those tips out but I am getting error:

> Undefined variable: dbPages in
> Fatal error: Call to a member function getList() on null

I am using Bludit 3 RC2.
User avatar
Edi
Site Admin
Posts: 1261
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Wed Sep 05, 2018 11:40 am

This part of the documentation is not yet updated. :oops:

Try the following:

Code: Select all

$publishedPages = $pages->getList($pageNumber, $numberOfItems, $onlyPublished);
instead of

Code: Select all

$pages = $dbPages->getList($pageNumber, $amountOfItems, $onlyPublished);
And

Code: Select all

foreach ($publishedPages as $pageKey) {
instead of

Code: Select all

foreach ($pages as $pageKey) {
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
kaaleth
Master Bludit
Posts: 112
Joined: Sun Jun 14, 2015 9:55 am
Contact:

Wed Sep 05, 2018 1:05 pm

Yeah, I thought so. Anyway, thanks I will try the code and give you a feedback.
Post Reply