PHPackages                             qbus/contao-fallback-articles - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. qbus/contao-fallback-articles

ActiveContao-module[Utility &amp; Helpers](/categories/utility)

qbus/contao-fallback-articles
=============================

A basis for defining methods that can get fallback articles when a page has no articles for a particular layout section.

1.3.0(6y ago)0721LGPL-3.0+PHPPHP &gt;=5.4.0

Since Mar 2Pushed 5y ago2 watchersCompare

[ Source](https://github.com/qbus-agentur/contao-fallback-articles)[ Packagist](https://packagist.org/packages/qbus/contao-fallback-articles)[ RSS](/packages/qbus-contao-fallback-articles/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (8)Used By (1)

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
---------------

[](#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
-----

[](#usage)

Fallback Articles provides the hook `getFallbackArticles`, language labels for implementations, and integration options in `tl_layout`.

### Hook `getFallbackArticles`

[](#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

[](#example)

Register the hook:

```
// config/config.php
$GLOBALS['TL_HOOKS']['getFallbackArticles']['example_fallback_name'] = [
    'ExampleHookClass',
    'onGetFallbackArticles'
];

```

Implement your fallback method:

```
class ExampleHookClass
{
    public function onGetFallbackArticles($pageId, $section)
    {
        return $this->exampleFallbackMethod($pageId, $section) ?? false;
    }

    protected function exampleFallbackMethod($pageId, $section): ?string
    {
        // do something, return string or null
    }
}

```

### Language labels for the 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

[](#example-1)

```
// languages/en/fallback_articles_methods.php
$GLOBALS['TL_LANG']['fallback_articles_methods']['example_fallback_name'] = 'Example description';

```

or

```

        Example description

```

### Backend integration

[](#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
----

[](#todo)

Drop Contao 3.5 support and use the `getArticles` hook to get rid of the current replication of the core's module assembly.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~143 days

Recently: every ~177 days

Total

6

Last Release

2275d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dceb47f6094c1a5b55d10d91c60e77caa09eaa722f44dd3f099eb375de01b0c9?d=identicon)[qbus](/maintainers/qbus)

---

Top Contributors

[![gmpf](https://avatars.githubusercontent.com/u/13484650?v=4)](https://github.com/gmpf "gmpf (14 commits)")

### Embed Badge

![Health badge](/badges/qbus-contao-fallback-articles/health.svg)

```
[![Health](https://phpackages.com/badges/qbus-contao-fallback-articles/health.svg)](https://phpackages.com/packages/qbus-contao-fallback-articles)
```

###  Alternatives

[psi/news4ward

A blogging / news system for Contao

131.4k13](/packages/psi-news4ward)[tastaturberuf/anystores

Location management and geographic search

121.7k](/packages/tastaturberuf-anystores)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
