magento - Create Custom layout module -
hi created custom module in magento , frontend doesn't work.
the config file :
<?xml version="1.0"?> <config> <modules> <shareino_sync> <version>0.1.0</version> </shareino_sync> </modules> <global> <helpers> <sync> <class>shareino_sync_helper</class> </sync> </helpers> <blocks> <sync> <class>shareino_sync_block</class> </sync> </blocks> </global> <frontend> <routers> <sync> <use>standard</use> <args> <module>shareino_sync</module> <frontname>shareinosync</frontname> </args> </sync> </routers> <layout> <updates> <sync> <file>shareino_front.xml</file> </sync> </updates> </layout> </frontend> </config>
the layout file :
# file in : app/design/frontend/default/default/layout/shareino_front.xml <layout version="0.1.0"> <sync_index_index> <reference name="content"> <block type="sync/sync" name="sync" template="sync_index.phtml" /> </reference> </sync_index_index> </layout>
and sync_index.phtml
:
# file in app/design/frontend/default/default/template/sync_index.phtml <h1> test text </h1>
i created block named sync.php
class shareino_sync_block_sync extends mage_core_block_template { public function myfunction() { return "hello tuts+ world"; } }
at end controller :
class shareino_sync_indexcontroller extends mage_core_controller_front_action { public function indexaction(){ $this->loadlayout(); $this->renderlayout(); } public function testaction(){ echo "index action"; } }
i think done every think , when load action url in browser doesn't layout. please me know wrong.
check current theme, maybe not default/default. if different, place layout , templates under theme. or put base/default theme compatibility themes.
make sure module registered in app/etc/modules/shareino_sync.xml
.
and last, maybe module disabled output. goes system
->configuration
->advanced
->advanced
->disable module output
find module , make sure enabled.
Comments
Post a Comment