Closed lmartins closed 1 year ago
Going to answer my own question in the hope this may be useful to someone.
Apparently the way to achieve this would be:
$query = Post::builder()->limit(9)->orderBy('date_published', 'desc');
$context['posts'] = $query->get();
$context['pagination'] = Timber::get_pagination($query->getParameters());
Would be great to get some update on the status of Lumberjack. Project appears to be stale judging from the activity on this repo, so any info would be awesome. Thank you.
Not sure if I'm missing something in the docs, but I couldn't locate an answer to this on the site.
Can't seem to be able to get pagination to work properly when using the query builder.
With a query like:
I've went on to try accessing
posts.pagination
, that didn't worked, and lastly tried to build out the pagination object using Timber's own method by passing that QueryBuilder params, like this:This, while creating a pagination object, does not seem to interact with the query from Lumberjack, as navigating to different pages has no effect on the posts being listed (always shows the posts from page 1).
When using Timber's default query methods, as follows, pagination works properly:
Am I missing obvious here? Thank you!