Invalid Blocktype
Invalid Blocktype
I try to help a user on magento.stackexchange. So I created his extension and created a new CMS site with the following content:
block type="atwix/cmsattr" template="atwix/cmsattr/list.phtml"
I also allowed the block in the backend at (System -> Permissions -> Blocks).
But if I call the site, then there is no output from the block.
app/code/local/Atwix/Cmsattr/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Atwix_Cmsattr>
<version>0.1.0</version>
</Atwix_Cmsattr>
</modules>
<global>
<blocks>
<atwix_cmsattr>
<class>Atwix_Cmsattr_Block</class>
</atwix_cmsattr>
</blocks>
<models>
<atwix_cmsattr>
<class>Atwix_Cmsattr_Model</class>
</atwix_cmsattr>
</models>
</global>
</config>
app/code/local/Atwix/Cmsattr/Block/List.php
<?php
class Atwix_Cmsattr_Block_List extends Mage_Catalog_Block_Product_Abstract
protected $_itemCollection = null;
public function getItems()
$color = $this->getColor();
if (!$color)
return false;
if (is_null($this->itemCollection))
$this->_itemCollection = Mage::getModel('atwix_cmsattr/products')->getItemsCollection($color);
return $this->_itemCollection;
app/design/frontend/rwd/default/template/atwix/cmsattr/list.phtml
I replaced his template content with "hello world"
What is going on?
2 Answers
2
app/etc/modules
System/Configuration/Advanced
block type="atwix_cmsattr/list" template="atwix/cmsattr/list.phtml"
That should do the trick.
I solved it. I had to use
block type="atwix_cmsattr/list" template="atwix/cmsattr/list.phtml"
Thanks for contributing an answer to Magento Stack Exchange!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy