Source: https://stackoverflow.com/a/12288000/158325
Found a working solution using Alan Storm's advice.
/template/custom/featured-product.phtml
<?php
$_categoryId = $this->getCategoryId();
$_productCollection = Mage::getModel('catalog/category')->load($_categoryId)
->getProductCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('status', 1)
->addAttributeToFilter('visibility', 4)
->setOrder('price', 'ASC');
?>
<div class="featured-product">
<h2><?php echo $this->__( $this->getLabel() ); ?></h2>
<?php foreach ($_productCollection as $_product): ?>
<div class="item">
<a class="product-image" href="<?php echo $_product->getProductUrl() ?>">
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(200); ?>" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
</a>
<a class="product-name" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a>
<?php echo $this->getPriceHtml($_product, true) ?>
</div>
<?php
// Note: Exit after first product.
break;
?>
<?php endforeach ?>
</div>
In short, the collection is manually generated rather than receiving a collection (as my initial attempt did):
<?php $_productCollection = $this->getLoadedProductCollection() ?>
<?php $_collectionSize = $_productCollection->getSize(); ?>
Using in a CMS Page:
{{block type="core/template" category_id="13" label="Product of the Month" template="custom/featured-product.phtml" }}
Using in a template:
/layout/local.xml
<default>
<reference name="footer">
<block type="core/template" name="custom.featuredProduct" as="featured_product" template="custom/featured-product.phtml">
<action method="setData"><key>category_id</key><value>13</value></action>
<action method="setData"><key>label</key><value>Product of the Month</value></action>
</block>
</reference>
</default>
/template/page/html/footer.phtml
<?php echo $this->getChildHtml('featured_product') ?>
Helpful resources:
How to get a product collection:
Using magic getters/setters: