0

I Created module i try to call my category page but it not showing

layout.xml

<reference name="content">   
      <block type="gallery/index" name="gallery_index" template="gallery/index.phtml"/>   
    </reference> 

in static block i call this way

{{block type="gallery/index" name="gallery" template="gallery/index.phtml"}}

then i call this static block my category but it not working

config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <MPS_Gallery>
      <version>0.1.0</version>
    </MPS_Gallery>
  </modules>
  <frontend>
    <routers>
      <gallery>
        <use>standard</use>
          <args>
            <module>MPS_Gallery</module>
            <frontName>gallery</frontName>
          </args>
      </gallery>
    </routers>
        <layout>
          <updates>
            <gallery>
              <file>gallery.xml</file>
            </gallery>
          </updates>
        </layout>
  </frontend>
  <admin>
        <routers>
            <gallery>
                <use>admin</use>
                <args>
                    <module>MPS_Gallery</module>
                    <frontName>gallery</frontName>
                </args>
            </gallery>
        </routers>
    </admin>
    <adminhtml>
        <menu>
            <gallery module="gallery">
                <title>Gallery</title>
                <sort_order>71</sort_order>                
                <children>
                    <items module="gallery">
                        <title>Manage Items</title>
                        <sort_order>0</sort_order>
                        <action>gallery/adminhtml_gallery</action>
                    </items>
                </children>
            </gallery>
        </menu>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <gallery>
                            <title>gallery Module</title>
                            <sort_order>200</sort_order>
                        </gallery>
                    </children>
                </admin>
            </resources>    
        </acl>
        <layout>
            <updates>
                <gallery>
                    <file>gallery.xml</file>
                </gallery>
            </updates>
        </layout>
    </adminhtml>  
  <global>
    <models>
            <gallery>
                <class>MPS_Gallery_Model</class>
                <resourceModel>gallery_mysql4</resourceModel>
            </gallery>
            <gallery_mysql4>
                <class>MPS_Gallery_Model_Mysql4</class>
                <entities>
                    <gallery>
                        <table>gallery</table>
                    </gallery>
                </entities>
            </gallery_mysql4>
        </models>
        <resources>
            <gallery_setup>
                <setup>
                    <module>MPS_Gallery</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </gallery_setup>
            <gallery_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </gallery_write>
            <gallery_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </gallery_read>
        </resources>
    <helpers>
      <gallery>
        <class>MPS_Gallery_Helper</class>
      </gallery>
    </helpers>
    <blocks>
      <gallery>
        <class>MPS_Gallery_Block</class>
      </gallery>
    </blocks>
    <resources>
      <gallery_setup>
        <setup>
          <module>MPS_Gallery</module>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </gallery_setup>
      <gallery_write>
        <connection>
          <use>core_write</use>
        </connection>
      </gallery_write>
      <gallery_read>
        <connection>
          <use>core_read</use>
        </connection>
      </gallery_read>
    </resources>
  </global>
</config> 
8
  • Please add your config file code to question Mar 27, 2017 at 5:59
  • Plese check my updated question
    – Develop
    Mar 27, 2017 at 6:01
  • Make sure you have the file with name gallery.xml in app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout and your template file index.phtml in app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/gallery folder Mar 27, 2017 at 6:04
  • in my frontend url it's working fine i can't able to use this my category page
    – Develop
    Mar 27, 2017 at 6:05
  • is MPS/Gallery/Block/Index.php file is there ?? Mar 27, 2017 at 6:16

1 Answer 1

2

Give permission to that block

system -> permission -> Blocks -> Click add new Block

enter image description here

then Save Block

and Make sure your block name should be unique.

2
  • I am using Magento ver. 1.9.1.1 i did't see any Block tab
    – Develop
    Mar 27, 2017 at 6:33
  • Sorry but Currently I am not having 1.9.1.1 setup to get verify @Develop Mar 27, 2017 at 6:55

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.