diff --git a/packages/vitec/Classes/UserFunc/NewsJsonRenderer.php b/packages/vitec/Classes/UserFunc/NewsJsonRenderer.php index 43eeec7..5f3dbe6 100644 --- a/packages/vitec/Classes/UserFunc/NewsJsonRenderer.php +++ b/packages/vitec/Classes/UserFunc/NewsJsonRenderer.php @@ -155,7 +155,39 @@ final class NewsJsonRenderer return json_encode($response) ?: ''; } + // Server-side pagination for the big overview list (contract + // 0070-FE/0075-BE): only a plain/sticky list WITHOUT a limit and + // WITHOUT a hand-picked selection paginates. That is exactly the + // /insights/news element (#130); every teaser list carries a + // limit (1-3) and keeps today's full behaviour, as do selected/ + // search lists - the frontend falls back to client-side paging + // wherever the `pagination` key is absent. + $paginated = in_array($type, ['news_pi1', 'news_newsliststicky'], true) + && (int)($settings['limit'] ?? 0) === 0 + && trim((string)($settings['selectedList'] ?? '')) === ''; + + if ($paginated + && $this->cObj !== null + && $this->cObj->getUserObjectType() === ContentObjectRenderer::OBJECTTYPE_USER + ) { + // `page`/`category` sit in cacheHash.excludedParameters, so the + // TYPO3 page cache does NOT distinguish the query variants - + // a cacheable render would bake page 1 in for every URL. As + // USER_INT the element renders per request; EXT:headless wraps + // the INT marker itself (JsonContentObject detects + // '