【发布时间】:2015-07-03 16:54:27
【问题描述】:
我在 magento 上使用自定义主题,在 header.phtml 中使用了以下代码:
<div class="logo">
<a href="<?php echo $this->getUrl('') ?>">
<img src="<?php echo $this->getSkinUrl('').'images/logo_white.gif'//$this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
</a>
</div>
当我第一次加载主页时,getSkinUrl 给了我这个路径:
http://site.address.com/skin/frontend/THEME/DEFAULT/images/logo_white.gif
但是,当我加载任何其他页面时,我得到:
http://site.address.com/skin/frontend/THEME/THEME/images/logo_white.gif
如果不是任何地方的主页,我无法找到为什么皮肤路径会改变。唯一不同的是,我们有这样一种效果,即在基础上添加一个徽标以改变颜色:
<?php if ($this->getIsHomePage()):?>
<div class="back-header">
<div class="logo">
<a href="<?php echo $this->getUrl('') ?>">
<img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
</a>
</div>
</div>
<?php endif;?>
但这以前有效吗?
让我知道你们的想法。谢谢!
【问题讨论】:
标签: php css magento url-rewriting theming