我想在我的drupal站点上显示两个不同的标志:一个用于首页,另一个用于内部页面。如何获取drupal中sites/all文件夹的绝对路径?
if (drupal_is_front_page()) {
$variables['logo']=drupal_get_path('theme', 'hanna') . '/images/logo.png';
}
else {
$variables['logo']=drupal_get_path('theme', 'hanna') . '/images/logo-inner.png';
}
这只是正常的头版,并具有websiteurl /页的URL的任何页面;但是,它不适用于网址类似于websiteurl/custompath/page的页面。
我认为问题在于具有自定义URL路径的页面的相对性。
你有什么想法吗?
是的,我已经使用了base_path()。drupal_get_path('theme','hanna')。 '/images/logo.png'; –
你是对的:base_path()甚至是更好的解决方案:) – Nebel54