<?php
/**
 * Maho
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2022 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Category view template
 *
 * @var Mage_Catalog_Block_Category_View $this
 */
?>
<?php
    $_helper    = $this->helper('catalog/output');
    $_category  = $this->getCurrentCategory();
    $_imgHtml   = '';
    if ($_imgUrl = $_category->getImageUrl()) {
        $_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" /></p>';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
    }
?>
<div class="page-title category-title">
    <?php if($this->isRssCatalogEnable() && $this->isTopCategory()): ?>
        <a href="<?= $this->getRssLink() ?>" class="link-rss"><?= $this->__('Subscribe to RSS Feed') ?></a>
    <?php endif ?>
    <h1><?= $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h1>
</div>

<?= $this->getMessagesBlock()->toHtml() ?>

<?php if($_imgUrl): ?>
    <?= $_imgHtml ?>
<?php endif ?>

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

<?php if($this->isContentMode()): ?>
    <?= $this->getCmsBlockHtml() ?>

<?php elseif($this->isMixedMode()): ?>
    <?= $this->getCmsBlockHtml() ?>
    <?= $this->getProductListHtml() ?>

<?php else: ?>
    <?= $this->getProductListHtml() ?>
<?php endif ?>
