【发布时间】:2015-07-20 19:31:44
【问题描述】:
我正在使用 magento 1.7.0.2,我遇到了一个问题并用谷歌搜索了所有解决方案,但对我不起作用...
我的问题是我想在我的 2Column-left.phtml 布局中添加 If 条件。 比如,如果我在主页上,我想显示此内容
**<div><?php echo $this->getChildHtml('sectionA') ?></div>**
<div class="product-content section-content-2">
<div class="container">
<div class="col-left sidebar">
<?php echo $this->getChildHtml('left') ?>
</div>
<?php echo $this->getChildHtml('content') ?>
</div>
</div>
如果我不在主页上:
<div class="product-content section-content-2">
<div class="container">
<div class="col-left sidebar">
<?php echo $this->getChildHtml('left') ?>
</div>
<?php echo $this->getChildHtml('content') ?>
**<div><?php echo $this->getChildHtml('sectionA') ?></div>**
</div>
</div>
我使用了所有解决方案,例如:
http://dltr.org/blog/magento/187/Magento-How-to-find-if-you-are-on-homepage-getIsHomePage
Detect home page in Magento .phtml that will work with BLOCK_HTML cache enabled
但不工作...请帮助并建议我应该做什么或我是否犯了错误???
谢谢
【问题讨论】:
标签: php magento magento-1.7