Adam Capps
Adam Capps

Reputation: 119

My module in magento is active but not showing up

I have a module (capps_cact) that I cannot see the html output on the front end. I know my etc/module/capps_cact.xml file is working because I can go into the backend of magento and disable the output (config/developers/advanced). All I am trying to do with this is add the following before the closing body tag.

In my config file all I have is a reference to a layout update file. In the layout update file I just call a phtml file that only has that block to add before the closing body. I will paste my code for all files below, and here is a link to download the zip files (i thought that might be easier). My Source

first my capps_cact.xml located in app/etc/modules/capps_cact.xml

<?xml version="1.0"?>
<config>
<modules>
    <capps_cact>
        <active>true</active>
        <codePool>local</codePool>
    </capps_cact>
</modules>
</config> 

now my extension in app/code/local/capps/cact/etc/config.xml

<?xml version="1.0"?>
<config>
<modules>
    <capps_cact>
        <version>1.0.0</version>
    </capps_cact>
</modules>
<frontend>
   <layout>
        <updates>
            <capps>
                <file>cact.xml</file>
            </capps>
        </updates>
    </layout>
</frontend>
</config>

now my layout file in app/design/frontend/base/default/layout/cact.xml

<?xml version="1.0"?>
<layout version="0.1.0">
<default>
    <reference name="before_body_end">
        <block type="capps/cact" name="capps_cact" as="capps_cact" template="capps/cact.phtml" />
    </reference>
</default>
</layout>

now my block file in app/design/frontend/base/default/template/capps/cact.phtml which just has the one line.

<!-- This is a test -->

Upvotes: 1

Views: 1497

Answers (1)

MagePal Extensions
MagePal Extensions

Reputation: 17656

Your module is not configure correctly ...

  1. Cact.xml should be cact.xml

  2. you do not have a block type type="capps/cact" (should be in app/code/local/Capps/Cact/Block/Cact.php) or you could change the block type Understanding Magento Block and Block Type

Take a look @

http://excellencemagentoblog.com/magento-part4-series-helloworld

http://www.gravitywell.co.uk/blog/post/how-to-creating-your-own-custom-block-in-magento

Upvotes: 1

Related Questions