New answers tagged

2

You could add a new param to the request called skip and use that on your homepage, and default it to zero to allow you to reuse the endpoint elsewhere. $skipEntries = Craft::$app->request->getParam('skip') ?? 0; $criteria = [ 'section' => $settings['section'], 'limit' => $settings['limit'], 'offset' => ($settings['limit'] * ...


2

If you always want to skip the first 6 entries, you can modify the Element API endpoint to add 6 to the offset number in the query criteria: $criteria = [ 'section' => $settings['section'], 'limit' => $settings['limit'], 'offset' => ($settings['limit'] * Craft::$app->request->getParam('offset')) + 6, 'order' => $settings['...


2

Here's a cut-down version of what I'm using on https://cld.agency/showcase It's using jQuery because that's the way I like it: {% set theLayout = craft.app.request.isAjax and not craft.app.request.isLivePreview ? '_ajaxLayout' : '_layout' %} {% extends theLayout %} {% set entries = craft.entries.section('news').limit(12) %} {% paginate entries as pageInfo, ...


Top 50 recent answers are included