Question: I've built a new Page-Template in Magento. On this template I will show the Category-Image and after that, the product grid (as standard). How can I get the Category-Image for my Template?

From my Template:

```
<div class="col-main grid4-3 grid-col2-main in-col2">
    <?php echo $this->getChildHtml('global_messages') ?>
    <div class="worlds-image"">Category Image</div>
    <?php echo $this->getChildHtml('content') ?>
</div>

```

Answer: 
If you want to get the thumbnail image of the current category that you are browsing, then use the following code:

```
<?php $categoryImage = Mage::getModel('catalog/layer')->getCurrentCategory()->getThumbnail(); //Get the file name of the Image stored for the category ?>

<img src="<?php echo Mage::getBaseUrl('media').'catalog/category/'.$categoryImage  ?>" />

```
An easier way to grab the full url of the category image (on Magento 1.7, anyway) is to use the function "getImageUrl()". Thus, we can grab more or less the same code from the category view.phtml to create our category image...

```
<?php 
     $_category = Mage::getModel('catalog/layer')->getCurrentCategory();
     $_catImgHtml = '';
     if ($_catImgUrl = $_category->getImageUrl()) {
         $_catImgHtml = '<p class="category-image"><img src="'.$_catImgUrl.'" alt="'.$this->escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" /></p>';
         $_catImgHtml = $_helper->categoryAttribute($_category, $_catImgHtml, 'image');
     }
?>

```

You can even simplify this if all you want is a bare link:

```
$_catImgHtml = '<img src="'.$_catImgUrl.'">';

```

followed by...

```
<?php if($_catImgUrl): ?>
     <?php echo $_catImgHtml ?>
<?php endif; ?>

```