Download the PHP package qbus/contao-fallback-articles without Composer
On this page you can find all versions of the php package qbus/contao-fallback-articles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download qbus/contao-fallback-articles
More information about qbus/contao-fallback-articles
Files in qbus/contao-fallback-articles
Package contao-fallback-articles
Short Description A basis for defining methods that can get fallback articles when a page has no articles for a particular layout section.
License LGPL-3.0+
Informations about the package contao-fallback-articles
Contao Fallback Articles
This Contao extension provides a basis for developers to implement methods that can get fallback articles when a page has no articles for a layout section.
Implementations
qbus/contao-inherit-fallback-articles
: Inherit articles from the next section up the page tree that does contain articles.qbus/contao-home-fallback-articles
: Get articles from the appropriate layout section on the page tree's home page.
Usage
Fallback Articles provides the hook getFallbackArticles
, language labels for implementations, and integration options in tl_layout
.
Hook getFallbackArticles
The hook is called whenever a layout section does not contain any articles and a fallback method for that section is selected in the layout settings. The hook provides the page id and the name of the section. As a return value, it expects the fallback content as a string or false
if no content could be provided by the fallback method.
Your hook listener must be named in order for it to be usable in the layout settings.
Example
Register the hook:
Implement your fallback method:
Language labels for the fallback method
Use the name of your hook implementation as a key to provide a short description of your fallback method under the language key fallback_articles_methods
.
Example
or
Backend integration
Open the layout settings and select the checkbox "Define fallback articles". In the tabular field "Fallback articles", select the methods to be used per layout section. The methods are evaluated from bottom to top. The first one (from the bottom) to return any content "wins", i. e. the methods following it are not used. In other words, the fallback content in a section does not accumulate when multiple methods are defined.
TODO
Drop Contao 3.5 support and use the getArticles
hook to get rid of the current replication of the core's module assembly.
All versions of contao-fallback-articles with dependencies
contao-community-alliance/composer-plugin Version ~2.4 || ~3.0
contao/core-bundle Version ^3.5.5 || ~4.4
menatwork/contao-multicolumnwizard Version ^3.3.9