晚上,
我试图在 Magento 中编辑一个简单的代码,但我对 PHTML 完全陌生,而且我遇到了基础问题......
我想检查标题以设置自定义 div 供翻译人员调用...
这部分编辑的 PHTML 代码不起作用...
<?php if( $this->getConfig('title') ): ?>
<?php if( $this->getConfig('title') == 'Categories' ?>
<div class="block-title"><strong><?php echo $this->__('Categories') ?></strong></div>
<?php else: ?>
<div class="block-title"><strong><?php echo $this->getConfig('title') ?></strong></div>
<?php endif ?>
<?php endif; ?>
虽然此原始代码有效:
<?php if( $this->getConfig('title') ): ?>
<div class="block-title"><strong><?php echo $this->getConfig('title') ?></strong></div>
<?php endif; ?>
一些专家可以指出一个错误,所以我不会花很多时间在这上面吗?
提前致谢。