This is the code I used in Drupal 7.

            <a href="<?php print $base_path ?>" title="<?php print t('Home') ?>">
                <img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" />

This is the code I am using for Drupal 8.

           <a href="{{ base_path }}" title="{{ 'Home'|t }}">      
    <span>{{ logopath }}</span>
                <img src="{{logo}}" alt="{{ 'Home'|t }}" alt="T.M. Patel International School"/>

If I upload the logo, it doesn't display. What should I do now?


This Link might be helpful : http://www.lohmeyer.rocks/blog/2015/01/14/00187-print-your-themes-logo-path-drupal-8-twig.

I think you should define the logo path variable first into template.tpl in MyTheme_preprocess_page function.

One More thing you are trying to use {{logopath}} in 'span' tag and into 'src' its {{logo}}.


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