How do the variables in .twig files work? I am using a theme based off awesome zymphonies theme.
I'm trying to use the site_logo variable from page.html.twig, but it doesn't have access to it, instead I have to use the page.header region, which somehow (I need clarification as to how) calls upon the code in block--system-branding-block.html.twig and there I can use site_logo.
So my question is why site_logo can only be accessed from that twig, and what would I need to do in order to use site_logo, or any other variable in any other twig file?
The site_logo block is available in the page.header region because that logo block itself is placed into that region using Drupal's block layout: mydrupalsite.com/admin/structure/block
Drupal's template/twig system is a set in parent and children type templates. So the page.header region/template may print {{ site_logo }} - but the contents of {{ site_logo }} are outputted in block--system-branding-block.html.twig
Blocks are placed in regions so you can't really access a block directly in page.html.twig unless you add it programmatically.
Probably what you are looking to do is place the site_logo block into the region which approximates the position you want it to be displayed. Then if you want to &quot;fine tune&quot; it you can override that regions template using the following naming convention:
my_drupal_theme/templates/region--[region].html.twig

E.g.
my_drupal_theme/templates/region--header.html.twig

Then maybe your region--header.html.twig file looks like:
&lt;div class=&quot;my-custom-wrapper-class&quot;&gt;
  {{ site_logo }}
&lt;/div&gt;

What can be really helpful here is knowing the basics of twig template naming conventions - and also turning on &quot;twig template debugging&quot; which gives you template names you can use to override.
https://www.drupal.org/docs/theming-drupal/twig-in-drupal/twig-template-naming-conventions
https://www.drupal.org/docs/theming-drupal/twig-in-drupal/debugging-twig-templates#s-enable-debugging
Just for completeness: if you did want to load the logo directly in your page.html.twig you could add it via a hook_preprocess_HOOK
@file my_drupal_theme/my_drupal_theme.theme

/**
 * Implements hook_preprocess_page().
 */
function my_drupal_theme_preprocess_page(&amp;$variables) {
  $block_manager = \Drupal::service('plugin.manager.block');
  $plugin_block = $block_manager-&gt;createInstance('system_branding_block', []);
  $variables['site_logo'] = $plugin_block-&gt;build();
}