{"id":20961749,"url":"https://github.com/heimrichhannot/contao-newsnavigation-bundle","last_synced_at":"2026-02-23T11:39:42.532Z","repository":{"id":62515545,"uuid":"106404275","full_name":"heimrichhannot/contao-newsnavigation-bundle","owner":"heimrichhannot","description":"Add previous and next article template tags to a news article","archived":false,"fork":false,"pushed_at":"2024-11-28T11:33:27.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"v3","last_synced_at":"2025-10-24T05:47:42.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heimrichhannot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-10T10:45:53.000Z","updated_at":"2024-11-28T11:33:31.000Z","dependencies_parsed_at":"2025-01-20T00:51:07.558Z","dependency_job_id":"db7adbda-ccf6-47c0-b440-8c6715369816","html_url":"https://github.com/heimrichhannot/contao-newsnavigation-bundle","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/heimrichhannot/contao-newsnavigation-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsnavigation-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsnavigation-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsnavigation-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsnavigation-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heimrichhannot","download_url":"https://codeload.github.com/heimrichhannot/contao-newsnavigation-bundle/tar.gz/refs/heads/v3","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimrichhannot%2Fcontao-newsnavigation-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T02:16:26.741Z","updated_at":"2026-02-23T11:39:42.511Z","avatar_url":"https://github.com/heimrichhannot.png","language":"PHP","readme":"# Contao Newsnavigation Bundle\n\n[![](https://img.shields.io/packagist/v/heimrichhannot/contao-newsnavigation-bundle.svg)](https://packagist.org/packages/heimrichhannot/contao-newsnavigation-bundle)\n[![](https://img.shields.io/packagist/l/heimrichhannot/contao-newsnavigation-bundle.svg)](https://packagist.org/packages/heimrichhannot/contao-newsnavigation-bundle)\n[![](https://img.shields.io/packagist/dt/heimrichhannot/contao-newsnavigation-bundle.svg)](https://packagist.org/packages/heimrichhannot/contao-newsnavigation-bundle)\n![](https://img.shields.io/badge/PHPStan-level%205-brightgreen.svg?style=flat)\n\n\nA [contao](https://contao.org/de/) extension to provide a simple navigation between news articles. It add template variables to go from one news article to the next or the previous article. \nNews article order is calculated by time property.\n\n![screenshot.png](docs/screenshot.png)\n\n## Features\n\n* add Template variables to NewsReaderModule to jump between news articles\n* customize article navigation with custom filters\n\n## Installation\n\nInstall via composer:\n\n```\ncomposer require heimrichhannot/contao-newsnavigation-bundle\n```\n\n## Usage\n\nThe bundle provides two new variables for news reader templates: `nextArticle` and `previousArticle`.\n\nTwig example:\n```twig\n{% if previousArticle|default %}\n    \u003ca href=\"{{ previousArticle.url }}\" class=\"previous\"\u003e\n        {{ previousArticle.label }}\n    \u003c/a\u003e\n{% endif %}\n\n{% if nextArticle|default %}\n    \u003ca href=\"{{ nextArticle.url }}\" class=\"next\"\u003e\n        {{ nextArticle.label }}\n    \u003c/a\u003e\n{% endif %}\n```\n\nHTML5 example:\n```php\n\u003c?php if ($this-\u003epreviousArticle): ?\u003e\n    \u003ca href=\"\u003c?= $this-\u003epreviousArticle-\u003eurl ?\u003e\" title=\"\u003c?= $this-\u003epreviousArticle-\u003etitle ?\u003e\"\u003e\u003c?= $this-\u003epreviousArticle-\u003elabel ?\u003e\u003c/a\u003e\n\u003c?php endif; ?\u003e\n\u003c?php if ($this-\u003enextArticle): ?\u003e\n    \u003ca href=\"\u003c?= $this-\u003enextArticle-\u003eurl ?\u003e\" title=\"\u003c?= $this-\u003enextArticle-\u003etitle ?\u003e\"\u003e\u003c?= $this-\u003enextArticle-\u003elabel ?\u003e\u003c/a\u003e\n\u003c?php endif; ?\u003e\n```\n\n## Customize article navigation\n\nTo customize which articles are shown as next and previous, you can use the [NewsNavigationFilterEvent](src/Event/NewsNavigationFilterEvent.php) event. \nIt gets passed a filter instance and the `ModuleModel` instance.\nTo modify the filter, use the methods of the filter object.\n\nExample:\n\n```php\nuse HeimrichHannot\\NewsNavigationBundle\\Event\\NewsNavigationFilterEvent;\n\nfunction __invoke(NewsNavigationFilterEvent $event): void\n{        \n    if ($event-\u003emodel-\u003esomeCustomTstamp) {\n        $event-\u003efilter-\u003esetColumns(array_merge($event-\u003efilter-\u003egetColumns(), ['someCustomTstamp\u003e=?']));\n        $event-\u003efilter-\u003esetValues(array_merge($event-\u003efilter-\u003egetValues(), [$event-\u003emodel-\u003esomeCustomTstamp]));\n    }\n    \n    if (!empty(StringUtil::deserialize($event-\u003emoduleModel-\u003ecategories, true))) {\n        $filter-\u003esetColumns(array_merge($filter-\u003egetColumns(), ['tl_news.categories IN (?)']));\n        $filter-\u003esetValues(array_merge($filter-\u003egetValues(), StringUtil::deserialize($event-\u003emoduleModel-\u003ecategories, true)));\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-newsnavigation-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheimrichhannot%2Fcontao-newsnavigation-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimrichhannot%2Fcontao-newsnavigation-bundle/lists"}