0

I am at a loss. I am trying to learn how to place this block on the index of my site but I cannot for the life of me get it to appear in the right area but I have been following guides to no avail.

I want my block to appear under the 'New Products' within the default sample data (After Mage_Catalog_Block_Product_New) but no luck. So far I am stuck at getting the block to appear so I can then do the rest. Edit: Have it working by hardcoding but not Progmatically

What I have so far is my module SiteTest and I am using the sample data with (rwd theme)
config.xml

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

    <frontend>
      <layout>
        <updates>
            <Sitetest>
                 <file>Sitetest.xml</file>
             </Sitetest>
         </updates>
      </layout>
    </frontend>

    <global>
        <blocks>
            <Sitetest>
                <class>Francis_SiteTest_Block</class>
            </Sitetest>
        </blocks>
    </global>
</config>

My Block called block.php

<?php
class Francis_SiteTest_Block_block extends Mage_Core_Block_Template
{
    // my large working method in here
}

My controller in IndexController.php

<?php
    class Francis_SiteTest_IndexController extends Mage_Core_Controller_Front_Action{
    public function indexAction(){
          $this->loadLayout();
          $this->renderLayout();
    }

    public function viewAction(){
          $this->loadLayout();
          $this->renderLayout();
    }
}

Followed up with app/design/frontend/rwd/default/template/Sitetest/block.phtml simply having my code I want executed

I expected this to render Under the New Products but I don't know where I have gone wrong. (or how badly for that matter).

0

1 Answer 1

1

You need to tell magento to use your radiatortest.xml by adding below lines in your modules's config.xml after </modules> tag

<frontend>
    <layout>
       <updates>
            <radiatortest>
                 <file>radiatortest.xml</file>
             </radiatortest>
        </updates>
    </layout>
</frontend>

Try this..

4
  • And don't forget to clear caches. Jun 14, 2014 at 14:10
  • Well that seems to be one issue fixed (I had that originally then got ride of it as it wasn't in other tuts.) Sadly still no Hello World though!
    – MageIdiot
    Jun 14, 2014 at 14:25
  • Can you see what error is coming in error.log or system.log file?
    – SIBHI S
    Jun 14, 2014 at 14:33
  • Placed the error in above text due to size.
    – MageIdiot
    Jun 14, 2014 at 15:23

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.