srhinow / contao-news-simple-bundle
Bildet das Contao2 Verhalten der Nachrichten nach. So wird ein Textfeld in den News-Einstellungen bereitgestellt ohne das extra Inhaltselemente befüllt werden müssen um die Detailansicht darzustellen. Evtl auch nützlich, um alte Contao-System auf eine aktuelle Contao-Version zu migrieren.
Package info
gitlab.com/srhinow/contao-news-simple-bundle
Type:contao-bundle
pkg:composer/srhinow/contao-news-simple-bundle
Requires
- php: >=8.3
- contao/core-bundle: ^5.3
- contao/news-bundle: ^5.3
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.5
README
Adds a plain text field directly to Contao news articles, eliminating the need to create separate content elements just to display article text. Mirrors the simpler news behaviour from Contao 2.x and is also useful when migrating older Contao installations to current versions.
A fork of felixpfeiffer/Contao-NewsSimple, rewritten for Contao 5.3+ and PHP 8.3+.
Requirements
- PHP
^8.3 - Contao
^5.3 contao/news-bundle ^5.3
Installation
composer require srhinow/contao-news-simple-bundle
After installation run php bin/console contao:migrate to add the newsText column to tl_news.
How it works
The bundle adds a newsText field (rich-text editor via TinyMCE) to the news edit form under a new Newstext legend. When a news article is rendered in the front end, the parseArticles hook prepends (or replaces) the template text with the value of newsText.
Behaviour modes
Controlled via System settings → Simple-News:
| Setting | Behaviour |
|---|---|
newsSimpleNoElements off (default) | newsText is prepended to any existing content-element output |
newsSimpleNoElements on | newsText replaces content-element output entirely; the content-element tab is hidden in the back end |
Running tests
vendor/bin/phpunit -c vendor/srhinow/contao-news-simple-bundle/phpunit.xml.dist