Built a module with one block - List.php
class Pts_HireCms_Block_List extends Mage_Core_Block_Template
{
protected $productRange;
public function loadCollection($productRange)
{
return Mage::getModel('hirecms/hire')
->getCollection()
->addFieldToFilter('product_range', $productRange)
->setOrder('position', 'asc');
}
public function getHireProd()
{
return $this->loadCollection('Hire Prods');
}
public function getNonHireProds()
{
return $this->loadCollection('Non Hire Prods');
}
}
Then I have a theme xml file of hirecms.xml:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="root">
<block type="hirecms/list" name="hireProd" template="hirecms/hire-prod.phtml" />
<block type="hirecms/list" name="nonHireProd" template="hirecms/non-hire-prod.phtml" />
</reference>
</default>
</layout>
and i've added:
{{block type="hirecms/list" template="hirecms/hire-prod.phtml"}}
to a static block, then on a category i've set display mode = static block only and cms block = to the one ive created.
However when i visit the route, the page loads but my block {{block type="hirecms/list" template="hirecms/hire-prod.phtml"}} is not being called.
Any ideas why?
I have this working perfectly on my local site, and the code has been pushed using github so no amendments along the way.
Thanks