How can I check whether the site is using the default theme logo or a custom logo?
When I use the Twig debug tools to dump the site_logo
variable, I only get the path of the logo, which doesn't tell me if that is the default theme logo.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIn a preprocess function, you can get that value with the following code:
$use_default = \Drupal::config('theme_machine_name.settings')->get('logo.use_default');
You can then stick that Boolean in the $variables
array and make use of it in a custom Twig template.