Direkt zum Inhalt

Devbits

Kleine Code-Schnipsel aus unserem Alltag mit Drupal, PHP und DevOps: Problem, Lösung, Code.

24.02.2026 | Lothar Ferreira Neumann

Hide a view if it yields no results

Displaying a view (a list of content) that has no items can be unnecessary if there is no need for a "no results" option. Views that are being hidden when empty can be useful for rich landing pages that aim to provide lots of relevant, additional recent content teasers to the user. However, there…

13.11.2025 | Lothar Ferreira Neumann

Set the homepage for anonymous users to login page

The homepage for visitors of your system should be the user login page (/user/login). This might make sense for logged-in only platforms and similar projects.

Access front page setting here: /admin/config/system/site-information

Set home page to user login
page:
  front: /user/login

Issue:

The homepage for visitors of your system should be the user login page (/user/login). This might make sense for logged-in only platforms and similar projects.

Solution:

Add /user/login in the `system.site.yml` to manipulate the front page.