0
votes

I am stuck in very simple task, I made a custom module and want to add a front end page.

I made a block for front end and used html for controller index function in module.xml file.

Below is module.xml

 <?xml version="1.0"?>
<config>
  <modules>
    <Coeus_Recurring>
      <version>0.1.0</version>
    </Coeus_Recurring>
  </modules>
  <frontend>
    <routers>
      <recurring>
        <use>standard</use>
          <args>
            <module>Coeus_Recurring</module>
            <frontName>recurring</frontName>
          </args>
      </recurring>
    </routers>
        <layout>
          <updates>
            <recurring>
              <file>recurring.xml</file>
            </recurring>
          </updates>
        </layout>
  </frontend>
  <global>
    <helpers>
      <recurring>
        <class>Coeus_Recurring_Helper</class>
      </recurring>
    </helpers>
    <blocks>
      <recurring>
        <class>Coeus_Recurring_Block</class>
      </recurring>
    </blocks>
    <models>
      <recurring>
        <class>Coeus_Recurring_Model</class>
        <resourceModel>recurring_mysql4</resourceModel>
      </recurring>
      <recurring_mysql4>
        <class>Coeus_Recurring_Model_Mysql4</class>
        <entities>        
              <recurring>
                <table>recurring_order</table>
              </recurring>
        </entities>
      </recurring_mysql4>
    </models>
        <events>
            <sales_order_place_after> <!-- identifier of the event we want to catch -->
                <observers>
                    <sales_order_place_after_handler> <!-- identifier of the event handler -->
                        <type>model</type> <!-- class method call type; valid are model, object and singleton -->
                        <class>recurring/observer</class>  <!-- observers class alias -->
                        <method>saverecurring</method>  <!-- observer's method to be called -->
                        <args></args> <!-- additional arguments passed to observer -->
                    </sales_order_place_after_handler>
                </observers>
            </sales_order_place_after>
        </events>
    <resources>
      <recurring_setup>
        <setup>
          <module>Coeus_Recurring</module>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </recurring_setup>
      <recurring_write>
        <connection>
          <use>core_write</use>
        </connection>
      </recurring_write>
      <recurring_read>
        <connection>
          <use>core_read</use>
        </connection>
      </recurring_read>
    </resources>
  </global>
</config> 

and last one, block in side code/local/Ns/Module/Block/Index.php code

class Ns_Module_Block_Index extends Mage_Core_Block_Template{ }

Its is very basic but don't know where I am lacking and my text in module/index.phtml is not showing on front end.

3
I have tried this but no success :( - murtza gondal

3 Answers

0
votes

You need to define the blocks for module 'module' inside config.xml :

<config>
 <global>
  <blocks>
   <module>Ns_Module_Block</module>
  </blocks>
 </global>
</config>
0
votes

just change your config.xml as per below to call block in your custom

<?xml version="1.0"?>
<config>
<frontend>
    <routers>
      <module>
        <use>standard</use>
          <args>
            <module>Ns_Module</module>
            <frontName>module</frontName>
          </args>
      </module>
    </routers>
        <layout>
          <updates>
            <module>
              <file>module.xml</file>
            </module>
          </updates>
        </layout>
  </frontend>
<global>
    <blocks>
        <module>
            <class>Coeus_Recurring_Block</class>
        </module>
    </blocks>
</global>
</config>

hope this will sure help you. let me know if i could help you further.

0
votes

ok I found the error!, in layout module.xml, block type should be "module/index"