I'm trying to create a new custom block module. /app/code/local/TutsPlus/Demo/etc/config.xml
<config>
<gllobal>
<models>
<demo>
<class>TutsPlus_Demo_Model</class>
</demo>
</models>
<blocks>
<demo><class>TutsPlus_Demo_Block</class></demo>
</blocks>
<helpers>
<demo>
<class>TutsPlus_Demo_Helper</class>
</demo>
</helpers>
<events>
<demo>
<type>model</type>
<class>demo/observer/</class>
<method>logCustomer</method>
</demo>
</events>
</gllobal>
<frontend>
<routers>
<tutsplus_demo>
<use>standard</use>
<args>
<module>TutsPlus_Demo</module>
<frontName>demo</frontName>
</args>
</tutsplus_demo>
<catalog>
<args>
<modules>
<demo before="Mage_Catalog">TutsPlus_Demo</demo>
</modules>
</args>
</catalog>
</routers>
<layout>
<updates>
<demo>
<file>tutsplus.xml</file>
</demo>
</updates>
</layout>
</frontend>
/app/code/local/TutsPlus/Demo/Block/Configurable.php
class TutsPlus_Demo_Block_Configurable extends Mage_Core_Block_Template {
public function getConfigurableProducts() {
return 'it works';
}
}
/app/code/local/TutsPlus/Demo/controllers/config.xml
class TutsPlus_Demo_IndexController extends Mage_Core_Controller_Front_Action {
public function configurableAction(){
$this->loadLayout();
$this->renderLayout();
}
}
configurable.phtml
<?php
echo 'zzz';
echo $this->getConfigurableProducts();
tutsplus.xml
<layout>
<tutsplus_demo_index_configurable>
<reference name="content">
<!--<block type="page/html" name="demo" template="tutsplus/configurable.phtml" />-->
<block type="tutsplus_demo/configurable" name="demo_configurable" template="tutsplus/configurable.phtml" />
</reference>
</tutsplus_demo_index_configurable>
</layout>
When I use commented line I heve just "zzz", no result of working function getConfigurableProducts. If I use second line I have nothing and file haven't been included.
EDIT 1 My folder structure
Put this code in tutsplus.xml
Remove following code from your config.xml
Refresh cache and storage and check it.