开发者

Drupal adaptive theme logo url links to outside site

I have drupal site that uses the adaptive theme. Now the link in the logo is directed to "/" (to root of my site) but I would like to change it so that it would dirent to outside site (www.domain.com). How can I do this?

This where the logo image is created in template.preprocess-page.inc but I have no clue where the URL gets to the logo. Any advie would be apprerciated!

$vars['logo_alt_text']    = check_plain(variable_get('site_name', '')) .' '. t('logo');
$vars['logo_img']         = $vars['logo'] ? '<img src="'. check_url($vars['logo']) .'" alt="'. $vars['logo_alt_te开发者_如何学编程xt'] .'" title="'. t('Home page') .'"/>' : '';
$vars['linked_site_logo'] = $vars['logo_img'] ? l($vars['logo_img'], '<front>', array('attributes' => array('rel' => 'home'), 'title' => t('Home page'), 'html' => TRUE)) : '';
$vars['linked_site_name'] = $vars['site_name'] ? l($vars['site_name'], '<front>', array('attributes' => array('rel' => 'home'), 'title' => t('Home page'))) : '';


This line sets the logo as a img link:

$vars['linked_site_logo'] = $vars['logo_img'] ? l($vars['logo_img'], '<front>', array('attributes' => array('rel' => 'home'), 'title' => t('Home page'), 'html' => TRUE)) : '';

With $vars['logo_img'] being the image, and <front> being the url for the link. l() is a function built into Drupal. Documentation on l()

Also you may wish to read more about preprocess functions: Setting up variables for use in a template (preprocess and process functions)


There are different file to be set for Drupal 6, 7 & 8. It may happen also in Drupal 9 and further.

On Drupal 6 set it in template.preprocess-page.inc.
On Drupal 7 we need to set it in template.php.
On Drupal 8 twig the vars in THEME.theme.

If your custom logo is not shown while your html code is already rendered in the page source then you may need to disable the theme logo by uncheck it on your theme setting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜