Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The problem:
In a multilingual site using the waffles theme, the site title and logo are linked to the default language front page instead of the current language front page - so that when you view any page in a non-default language and click on the site title or logo to go to the front page, you are switched from your current language to the default language.
Workaround:
in page.tpl.php, link logo and title to check_url($front_page) instead of $base_path - i.e.,
change
<?php if ($logo): ?>
<div id="logo">
<a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a>
</div>
<?php endif; ?>
<?php if ($site_name): ?>
<h1><a href="<?php print $base_path ?>" title="<?php print t('Home'); ?>"><?php print $site_name; ?></a></h1>
<?php endif; ?>
to
<?php if ($logo): ?>
<div id="logo">
<a href="<?php print check_url($front_page) ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a>
</div>
<?php endif; ?>
<?php if ($site_name): ?>
<h1><a href="<?php print check_url($front_page) ?>" title="<?php print t('Home'); ?>"><?php print $site_name; ?></a></h1>
<?php endif; ?>
Comments
Comment #1
B.X CreditAttribution: B.X commentedThanks, it works!