Magento类别布局 - 拆分目录/类别/ view.phtml

时间:2013-04-10 20:16:33

标签: magento layout categories

Magento 1.7.0.2

我有Templates Master安装的Easy Catalog Images。我想在此模块和下面列出的产品上方显示标题,RSS链接,描述等。

因此我将view.phtml拆分为title.ptmhl和view.phtml,并希望以下布局。

title.phtml

简易目录图像

view.phtml

我的title.phtml位于catalog / category / title.phtml,如下所示:

<?php
$_helper    = $this->helper('catalog/output');
$_category  = $this->getCurrentCategory();
$categoryName = $this->htmlEscape($_category->getName());
$_imgHtml   = '';
if ($_imageUrl = $_category->getImageUrl()) {
    $_imgHtml = '<img src="'.$_imageUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" />';
    $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
}?>
<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
    <div class="page-title category-title">
<?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
    <a href="<?php echo $this->getRssLink() ?>" class="link-feed right" title="<?php echo sprintf($this->__('Subscribe to the %s RSS Feed'), $categoryName) ?>" target="_blank"><?php echo sprintf($this->__('Subscribe to %s RSS Feed'), $categoryName) ?></a>
<?php endif; ?>
<h2><?php echo $_helper->categoryAttribute($_category, $this->htmlEscape($_category->getName()), 'name') ?></h2>
</div>

<?php if($_imgHtml): ?>
    <p><?php echo $_imgHtml?></p>
<?php endif; ?>
<?php if($_description=$_category->getDescription()): ?>
    <p class="category-description std"><?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?></p>
<?php endif; ?>
</div>

view.phtml已被更改为排除所有类&page 39;页面标题类别标题&#39;如上所述。

我尝试在catalog.xml中引用title.phtml,如下所示

        <reference name="content">
            <block type="catalog/category_title" name="category.title" template="catalog/category/title.phtml">
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">

title.phtml没有显示。

0 个答案:

没有答案
相关问题