Another issue with building my admin module!! I can't get the page to show! Already have the page and drop down links showing without errors like I had last week. Now I can't get my template page to show up. What am I doing wrong with declaring these blocks?
Config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Caitlinhavener_Addschool>
<version>0.1.0</version>
</Caitlinhavener_Addschool>
</modules>
<global>
<blocks>
<addschoolblock1>
<class>Caitlinhavener_Addschool_Block</class>
</addschoolblock1>
</blocks>
<helpers>
<addschool>
<class>Caitlinhavener_Addschool_Helper</class>
</addschool>
</helpers>
</global>
<admin>
<routers>
<adminhtml>
<use>admin</use>
<args>
<modules>
<Caitlinhavener_Addschool after="Mage_Adminhtml">Caitlinhavener_Addschool</Caitlinhavener_Addschool>
</modules>
</args>
</adminhtml>
</routers>
</admin>
</config>
adminhtml.xml:
<?xml version="1.0"?>
<config>
<menu>
<SchoolMenu translate="title" module="addschool">
<title>Schools</title>
<sort_order>23</sort_order>
<children>
<myitem2 translate="title" module="addschool">
<title>Add Schools</title>
<action>adminhtml/addschool</action>
<sort_order>2</sort_order>
</myitem2>
</children>
</SchoolMenu>
</menu>
</config>
controllers/Addschoolcontroller.php:
<?php
class Caitlinhavener_Addschool_AddschoolController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout();
$this->_addLeft($this->getLayout()->createBlock('Caitlinhavener_Addschool_Block_ShowTabsAdminBlock'));
$this->renderLayout();
}
}
Block/ShowTabsAdminBlock.php:
<?php
class Caitlinhavener_Addschool_Block_ShowTabsAdminBlock extends Mage_Adminhtml_Block_Widget_Tabs
{
public function __construct()
{
parent::__construct();
$this->setId('add_school');
$this->setTitle(Mage::helper('addschool')->__('Add Schools'));
}
protected function _beforeToHtml()
{
$this->addTab('add_public_school', array(
'label' => Mage::helper('addschool')->__('Add Public School'),
'title' => Mage::helper('addschool')->__('Add Public School'),
'content' => $this->getLayout()->createBlock("addschoolblock1/SampleBlockForTabAreaShowoffWithExtraInfo")->toHtml(),
'active' => false
));
return parent::_beforeToHtml();
}
}
Block/SampleBlockForTabAreaShowoffWithExtraInfo.php:
<?php
class Caitlinhavener_Addschool_Block_SampleBlockForTabAreaShowoffWithExtraInfo extends Mage_Adminhtml_Block_Template
{
public function __construct()
{
parent::__construct();
$this->setTemplate('Caitlinhavener/sample_for_tab_container.phtml');
}
}