Score:2

How to verify if a custom logo is used?

za flag

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.

Score:2
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.