2

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.

1 Answer 1

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.