开发者

Magento: Catalog Page 1 different from other pages

I want to setup the category catalog pages in Magento such that the first page contains the category image and the first three products in that category. Then the following pages con开发者_StackOverflow中文版tain six products per page without the category image.

I can't figure out how this can be done.


Unfortunately I don't think you can do this without a lot of work. You'll need to rewrite the logic of the pagination, change the page size depending on which page it is, & offset the returned collection.

However you can easily only have the category image displayed on the first page.

This line returns the current page number:

Mage::getBlockSingleton('page/html_pager')->getCurrentPage();

So in template/catalog/category/view.phtml you can just do a conditional around the category image display, find the section:

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

and replace it with:

<?php if($_imgUrl): ?>
    <?php if(Mage::getBlockSingleton('page/html_pager')->getCurrentPage()==1):?>
        <?php echo $_imgHtml ?>
    <?php endif; ?>
<?php endif; ?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜