Ok, i have custom module, which works as i wish it to work on a url www.mysite.com/mymodule. Now i want my module to be accessible with a block name from anylayout, also what do i have to do to embed on the CMS pages as well.

My working module layout (mymodule.xml)

<layout version="1.0">
    <reference name="head">
            <action method="addItem" ifconfig="...>
                     //js and css added here;
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        <reference name="content">
            <block type="core/template" name="mymodule" template="mycorp/mymodule/default.phtml"></block>

This is my layout for the module. Now suppose i want to access it on other layout handle suppose here

<catalog_category_default>...<reference name="content">HERE</reference>...</catalog_category_default> ?


you can add your in content just like below. now your block will show before category content.

<catalog_category_default><reference name="content"><block type="core/template" name="mymodule" name="mymodule" before="-" template="mycorp/mymodule/default.phtml"></block></reference></catalog_category_default>

you can directly call the block in cms

{{block type="core/template" template="mycorp/mymodule/default.phtml"}}
  • And what do i need to get this from cms pages ? widgets ? – Suman K.C Sep 6 '15 at 8:05
  • update the answer ... – Qaisar Satti Sep 6 '15 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.