3rd January 2023The path.matcher service can be used to detect the front page of the site.$isFront = \Drupal::service('path.matcher')->isFrontPage(); if ($isFront) { // Do something. }DrupalDrupal 9Drupal 10 Add new comment Your name Email The content of this field is kept private and will not be shown publicly. Comment Leave this field blank
Add new comment