2

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">
<default>
    <reference name="head">
            <action method="addItem" ifconfig="...>
                     //js and css added here;
            </action>
    </reference>
</default>
<mymodule_index_index>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="core/template" name="mymodule" template="mycorp/mymodule/default.phtml"></block>
        </reference>
</mymodule_index_index>

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> ?

1 Answer 1

1

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"}}
2
  • And what do i need to get this from cms pages ? widgets ?
    – Suman K.C
    Commented Sep 6, 2015 at 8:05
  • update the answer ... Commented Sep 6, 2015 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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