【发布时间】:2013-04-07 09:55:55
【问题描述】:
我的主题是名称(汽车),并且在 page.tpl.php 中有图像链接,我想用简短的方式显示此图像 任何人都可以帮助我..node.tpl.php 的大部分方法,但我需要用 page.tpl.php 显示图像
<img src="rightgallery/img/img1_thumb.jpg" alt="motherly" />
我尝试将此代码添加到 template.php 文件中
// helper variable path to theme
function car_preprocess_page(&$vars) {
$vars['thefullpath'] = $GLOBALS['base_url'] . "/" . $GLOBALS['theme_path'];
}
然后像这样打印路径但还是不行
<img src="<?php print $thefullpath; ?>rightgallery/img/img1_thumb.jpg" alt="motherly"
>
【问题讨论】:
-
最后一次 sn-p 的输出是什么?
标签: php drupal drupal-7 drupal-theming