Multilingual
Drupal 6: $base_path doesn't always point to the frontpage
Heine — Sun, 17/05/2009 - 19:13
Dear themers,
<a href="<?php print $base_path ?>" title="<?php print t('Home'); ?>" ...
.... in page.tpl.php breaks Home functionality on many multilingual sites.
Consider a multilingual site with English (prefix 'en') as the default language and Dutch (prefix 'nl') as a second language. While browsing the site in Dutch (eg http://example.com/nl/node/5), the homelink created with $base_path leads to http://example.com/, which is the default English content. Quite an unpleasant surprise for your visitors.
The correct URL to the homepage is $front_page. As this variable holds a URL, you still need to convert it to HTML by calling check_url on it:
<a href ="<?php print check_url($front_page) ?>" ...
If you maintain a theme on Drupal.org that doesn't use $front_page, please consider this a bugreport. Thanks.