2

I am practicing Magento, So I develop a new custom module . The module is working fine but I have a problem with my layout file. This is what i have got in my layout file.

<?xml version="1.0" encoding="UTF-8"?> 

<layout >


    <ias_myslideshow_index_index>

        <reference name="root">
            <action method="setTemplate">
                <template>page/1column.phtml</template>
            </action>
        </reference>

        <reference name="content">
            <block type="ias/myslideshow_slideshow" name="ias.myslideshow.slideshow" template="IAS/slideshow.phtml" output="toHtml" />
        </reference>

    </ias_myslideshow_index_index>



</layout>

In the block type if I write

block type="core/template"

Then every static content that I have written in the pthml is displayed but if I try to call a function written in my block it throws an error for not finding the method. If I change block type to

block type="ias/myslideshow_slideshow"

             OR

block type="ias/slideshow"

Nothing is display. No static content, no error.

I will really appreciate if some one can let me know what the wrong I am doing. below is my block and config file

public function myMessage(){

    return “I am Iyngaran, This is my module.”;

}

}

    public function myMessage(){

        return “I am Iyngaran, This is my module.”;

    }
}


<?xml version="1.0"?>
<config>
    <modules>
        <IAS_MySlideshow>
            <version>0.1.0</version>
        </IAS_MySlideshow>
    </modules>

    <global>

        <helpers>
        <IAS_MySlideshow>
            <class>IAS_MySlideshow_Helper</class>
        </IAS_MySlideshow>
    </helpers>


        <blocks>
            <IAS_MySlideshow>
                <class>IAS_MySlideshow_Block</class>
            </IAS_MySlideshow>
        </blocks>

        <models>
            <IAS_MySlideshow>
                <resourceModel>ias_myslideshow_resource</resourceModel>
            </IAS_MySlideshow>

            <ias_myslideshow_resource>
                <entities>
                    <slideshow>
                        <table>ias_myslideshow_slideshow</table>
                    </slideshow>
                </entities>
            </ias_myslideshow_resource>
        </models>

        <resources>
            <myslideshow_setup>
                <setup>
                    <module>IAS_MySlideshow</module>
                </setup>
            </myslideshow_setup>
        </resources>

    </global>

    <frontend>
        <routers>
            <IAS_MySlideshow>
                <use>standard</use>
                <args>
                    <module>IAS_MySlideshow</module>
                    <frontName>slideshow</frontName>
                </args>
            </IAS_MySlideshow>
        </routers>

        <layout>
            <updates>
                <IAS_MySlideshow>
                    <!--this file name can be any name-->
                    <file>slide-show.xml</file>
                </IAS_MySlideshow>
            </updates>
        </layout>
    </frontend>

    <admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <IAS_MySlideshow before="Mage_Adminhtml">IAS_MySlideshow_Adminhtml</IAS_MySlideshow>
                </modules>
            </args>
        </adminhtml>
    </routers>
    </admin>


</config>
  • Please try with IAS_MySlideshow/nameoftheblock (replace nameoftheblock with your block name). – michael Jan 21 '15 at 12:53
  • please see at amitbera.com/… – Amit Bera Jan 22 '15 at 5:28
1

please try to write below in block type if your module name is myslideshow and the file placed in block folder is slideshow.php because in magento block type "modulename/blockfilename"

"myslideshow/slideshow"

For above magento find block file in below path:

"myslideshow/block/slideshow.php"
  • Appreciate Hardik. I have resolved that. It was problem with my config file in etc directory Thanks a lot :) – karan Jan 21 '15 at 14:52

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.