Noob
Noob

Reputation: 154

Magento Admin Plugin

Okay it have diagnosed the problem with my admin module. The issue i got is that it is not displaying my template. I need to know what wrong with my layout?

here is my layout

<?xml version="1.0" ?>
<layout version="0.1.0">
    <management_adminhtml_index_index>
        <reference name="content">
            <block type="management/monblock"  name="afficher_monbloc" template="management/afficher.phtml" />
        </reference>
    </management_adminhtml_index_index>
    <management_adminhtml_database_index>
        <reference name="content">
            <block type="management/block"  name="dbdisplayadmin_block" template="management/dbdisplayadmin.phtml" />
        </reference>
    </management_adminhtml_database_index>
</layout>

This script is not calling my templates. Templates are here

afficher

<form action="<?php echo Mage::getUrl('test/index/save') ?>" method="post">
  <fieldset>
    <ul>
     <li>
       <label for="nom">Nom</label>
       <input type="text" id="nom" name="nom" />
     </li>
     <li>
         <label for="prenom">Prenom</label>
         <input type="text" id="prenom" name="prenom" />
     </li>
     <li>
        <label for="nom">Telephone</label>
        <input type="text" id="telephone" name="telephone" />
    </li>
     <li>
        <input type="submit" value="Save" />
    </li>
  </ul>
 </fieldset>
</form>
<?php
   echo $this->methodblock();
 ?>

dbdisplayadmin

<h1> DATABASE </h1>

<?php
   echo $this->methodblock();
?>

No idea whz it is not working i know my config.xml and blocks are correct. I have been trying to solve this for a while any ideas??

Upvotes: 1

Views: 36

Answers (1)

simonthesorcerer
simonthesorcerer

Reputation: 559

My guess is that management_adminhtml_index_index does not match your Controller file structure or module route path;

Maybe you can edit your question and add your Controller-directory structure and the actions you call. However, my workaround for this has always been to add the template file in the Block-file.

Note that your block class has to extend Mage_Adminhtml_Block_Template for this to work:

protected function _construct() {
    parent::_construct();
    $this->setTemplate('mydirectory/mytemplate.phtml');
    return $this;
}

Upvotes: 1

Related Questions