title: Magento custom module - unable to call block method from template
body: <p>I'm working on a custom module to display CMS content. I have a custom front controller which is working as expected. I'm able to call various front actions from the controller. I am using an existing template, which is also displaying as it should. I'm also loading a layout update xml file, from which I was able to remove the product menu, which I don't need, and add a reference block for my custom block's template file.</p>
  
  <p>I know the correct template override file is loading, as I'm testing with the following:</p>
  
  <pre><code>&lt;?php echo __FILE__ . " loaded &lt;br&gt;"; ?&gt;
  </code></pre>
  
  <p>Which is echoing the correct filename.</p>
  
  <p>However, when I call my custom block method from that same template file, I get nothing.</p>
  
  <p>My module namespace/module is Cmpreshn/Projects. Following is what I have so far:</p>
  
  <p>Config file in
  app/code/local/Cmpreshn/Projects/etc/config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;Cmpreshn_Projects&gt;
              &lt;version&gt;0.1.0&lt;/version&gt;
          &lt;/Cmpreshn_Projects&gt;
      &lt;/modules&gt;
      &lt;frontend&gt;
          &lt;routers&gt;
              &lt;projects&gt;
                  &lt;use&gt;standard&lt;/use&gt;
                  &lt;args&gt;
                      &lt;module&gt;Cmpreshn_Projects&lt;/module&gt;
                      &lt;frontName&gt;education&lt;/frontName&gt;
                  &lt;/args&gt;
              &lt;/projects&gt;
          &lt;/routers&gt;
      &lt;layout&gt;
          &lt;updates&gt;
              &lt;projects&gt;
                  &lt;file&gt;projects.xml&lt;/file&gt;
              &lt;/projects&gt;
          &lt;/updates&gt;
      &lt;/layout&gt;
      &lt;/frontend&gt;
      &lt;global&gt;
          &lt;blocks&gt;
              &lt;projects&gt;
                  &lt;class&gt;Projects_Block_List&lt;/class&gt;
              &lt;/projects&gt; 
          &lt;/blocks&gt;
      &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>Front controller in
  app/code/local/Cmpreshn/Projects/controllers/ProjectsController.php</p>
  
  <pre><code>&lt;?php
  
      class Cmpreshn_Projects_ProjectsController extends Mage_Core_Controller_Front_Action {
  
          public function indexAction(){
              $this-&gt;listAction();
          }
  
          public function listAction(){
  
              echo "list action called&lt;br&gt;";
  
              /* get request and save params to object */
              $this-&gt;request = Mage::app()-&gt;getRequest();
  
              /* layout overrides for this module in app/design/frontend/default/pmc1/layout/projects.xml */
              $this-&gt;loadLayout();
  
              /* use the education template */
              $this-&gt;getLayout()-&gt;getBlock("root")-&gt;setTemplate("page/pmc_education.phtml");
  
              /* render the layout */
              $this-&gt;renderLayout();
  
          }
  
      }
  </code></pre>
  
  <p>XML updates in
  app/design/frontend/default/pmc1/layout/projects.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;layout version="0.1.0"&gt;
      &lt;projects_projects_list&gt;
          &lt;remove name="top.menu"/&gt;
          &lt;reference name="content"&gt;
              &lt;block type="page/html" name="page" template="cmpreshn/projects/list.phtml" /&gt;
          &lt;/reference&gt;
      &lt;/projects_projects_list&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>Template overrides and call to custom block in
  app/design/frontend/default/pmc1/template/cmpreshn/project/list.phtml</p>
  
  <pre><code>&lt;?php echo __FILE__ . " loaded &lt;br&gt;"; ?&gt;
  &lt;?php echo $this-&gt;getProjectsList(); ?&gt;
  </code></pre>
  
  <p>Last but not least, my custom block class in
  app/code/local/Cmpreshn/Proejcts/Block/List.php</p>
  
  <pre><code>&lt;?php
  
      class Cmpreshn_Projects_Block_List extends Mage_Core_Block_Template {
  
          public function _construct() {
              parent::__construct();
              echo "projects list block constructor called&lt;br&gt;";
          } // end constructor
  
          public function getProjectsList() {
              echo "getProjectsList called &lt;br&gt;";
              return("getProjectsList called");
          }
  
      } // end class
  </code></pre>
  
  <p>As I mentioned previously, I am getting the output from the first line of my list.phtml template file, but no output from my custom block method, and no indication that my block is loading (no output from block _construct() method either )</p>
  
  <p>Any help is appreciated. I'm ready to pull my eyes out over this...</p>