Posts tagged category

layour

Magento tip: Place category image above main layout below nav

0

Sometime the default position of the category images (top of the main col above product grid) breaks the design of a site. Ideally what we want is a full page banner that runs the full width of the page.

layour-new

Desired Layout

layour

Default layout

Moving the category image above the two / three column layout and below the nav bar requires a few changes to your template.

 

 

 

 

 

 

 

 

  1. In app/design/frontend/default/[yourtheme]/template/catalog/category create category-image.phtml
  2. Add
  3. <?php if($_imageUrl=$this->getCurrentCategory()->getImageUrl()): ?>
            <p class="category-image"><img src="<?php echo $_imageUrl ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>" /></p>
        <?php endif; ?>
    
  4. Edit ./app/design/frontend/default/[yourtheme]/layout/page.xml and under the breadcrumbs reference add
  5. <block type="catalog/category_view" name="category_banner" as="category_banner" template="catalog/category/cat_img.phtml" />
    
  6. edit ./app/design/frontend/default/[yourtheme]/template/page/2columns-left.phtml
  7. <?php if (Mage::registry('current_category')) { ?>
    <div class="category-banner">
        <?php echo $this->getChildHtml('category_banner') ?>
    </div>
    <?php }?>
                 
    </div>
    
magento-logo

How to create a Random Featured Product list on home page in Magento

38


It seems some what amazing that such a simple request can be so tricky to track down. The scenario is simple. You want to display a set of products on your home page from a hidden category to be randomly displayed.

(more…)

wp-logo

Create a grid layout for a wordpress category

6

A couple of clever wordpress tricks make this quite an easy thing to accomplish.  Since wordpress introduced the thumbnail feature in 2.9.1 it is very easy for theme authors to add this and make magazine type layouts. There are 2 parts to making this work

(more…)

Go to Top