Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Backend Module Shows No Content
 
SwiftCol
Sr. Member
 
Total Posts:  85
Joined:  2008-05-22
 

I followed the instructions here to a T, and my module does appear to be created correctly. The Module name appears in the menu in the admin backend, but when I click on it, I get an empty page. (The headers and footer and everything load, but nothing inside the main content block.)

I manually inserted a row into the database table created from the script in the Wiki, but nothing appears. I then tried going to index.php/MODULE/adminhtml_MODULE/Edit/ and a basic add/edit page appeared. Great! So i entered the basic info and added it, checked in the database that the row was created (and it was) but still nothing appears when I go to the modules “main page” in the admin backend.

I’m still trying to figure out what everything in the wiki is even for, so I don’t know where the code that should be running that “main page” resides in order to fix it. I know many of you have gotten backend modules working, so i could really use your help.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

Almost 90% of the time this comes up it has to do with the layout XML file.  Make sure that is right for the admin section (/app/design/adminhtml/default/default/layout/).

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
 
SwiftCol
Sr. Member
 
Total Posts:  85
Joined:  2008-05-22
 

Adam, as I said in my PM, thanks for your replys.

First of all, I am not using the default theme in my adminhtml. (See my wiki on the subject) Because of this, my layout.xml file is localed under magento/app/design/adminhtml/default/MyCompany/layout/

Second of all, I have played around with moving my layout.xml file to and from the default/default folder, and even deleting it, and it’s not changing anything. It’s as if the layout.xml is useless. Any idea whats going on there? You seem to have a much better understand of Magento than I do at this point.

 
Magento Community Magento Community
Magento Community
Magento Community
 
SwiftCol
Sr. Member
 
Total Posts:  85
Joined:  2008-05-22
 

The Wiki above includes a template file for the module, but does not say anything about how you get the module to appear on any of Magento’s pages on the frontend. I have tried everything I can think of, and nothing I do makes any content appear on the front end from this module. It never even trys to load /app/design/frontend/<interface>/<theme>/template/<Module>/<module>.phtml like it should, and there are no instructions on how to make it do so.

Can I get some help from someone?

It shouldn’t take weeks of ignored forum posts and incomplete wiki instructions to do something as simple as create a new module.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gamelodge
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2007-08-31
Brisbane, Qld, Australia
 

What we need is from the magento team is to give us a ‘Skeleton’ module like the one you and alistek have made for us (excellent work) but an official ‘this is how you are supposed to do it’ would really be nice.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mkd
Jr. Member
 
Total Posts:  10
Joined:  2008-06-25
 

I was wondering if you found a solution for the empty admin screen.

I have the same issue. Everything is working, new module is active and visible under the right URL in frontend. In admin menu item is visable, but de default page is empty (index of ModuleController in controllers/Adminhtml/). The edit and new page do show up when the right URL is used: module/adminhtml_module/new/.

I adjusted the indexAction in controllers/Adminhtml/ModuleController.php from:

public function indexAction() {
  $this
->_initAction()
    ->
renderLayout();
}
to:
public function indexAction() {
  $this
->_initAction();
  
$this->_addContent($this->getLayout()->createBlock('module/adminhtml_module_grid'));
  
$this->renderLayout();
}

This does show the Grid view with the items I created. However I do not see an Add Item button.

Did you figured out how to display the right place under the index action? Or isn’t the Module Creator supposed to create such a page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mkd
Jr. Member
 
Total Posts:  10
Joined:  2008-06-25
 

Replied somewhat too fast, changed indexAction() of controllers/Adminhtml/ModuleController.php to:

public function indexAction() {
  $this
->_initAction();        
  
$this->_addContent($this->getLayout()->createBlock('module/adminhtml_module'));
  
$this->renderLayout();
}

Now the default page of the admin menu item for the module shows the ‘add item’ button and the items grid.

Don’t know if this is missing from the module creator, or if I missed something, but this works.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Fibo
Sr. Member
 
Avatar
Total Posts:  107
Joined:  2008-06-25
Marseille, France
 

Thx to this last post, I can get the module to display in the admin interface. cool smile

And now, how can I display my phtml in the frontend, eg in the ‘header’ block?  red face

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emma86
Sr. Member
 
Total Posts:  110
Joined:  2009-03-03
 

hello

has anyone got this working in 1.3?

I have followed tutorial and the table has been created and my mod appears in menu… however when i click it it takes me to 404 page not found.. its linking to index.php/news/adminhtml_news ... should it be index.php/admin/news or something?

Tried a thing combinations but none work

any idea? smile
many thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emma86
Sr. Member
 
Total Posts:  110
Joined:  2009-03-03
 

ah had cache.. its not 404.. its an actual php error.. :(

Block with name “adminhtml_news.grid” already exists

ring any bells? smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emma86
Sr. Member
 
Total Posts:  110
Joined:  2009-03-03
 

oh i worked it out.. in the wiki and above it says add the line ...

$this->_addContent($this->getLayout()->createBlock(’news/adminhtml_news’));

but as soon as i comment that out.. it all works :O haha wierd

 
Magento Community Magento Community
Magento Community
Magento Community
 
dolu
Member
 
Total Posts:  41
Joined:  2009-05-25
 
Emma86 - 23 April 2009 03:02 PM

oh i worked it out.. in the wiki and above it says add the line ...

$this->_addContent($this->getLayout()->createBlock(’news/adminhtml_news’));


but as soon as i comment that out.. it all works :O haha wierd

Thanks, that worked for me too!

Using Magento ver. 1.3.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
gangadhar
Jr. Member
 
Total Posts:  23
Joined:  2009-07-30
 

Can any one please tell me how to display the content that has been added in the admin menu.I have created a new module called “News"and all fields are displaying in the adminpage.I want to display the data in the front end.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cosmin Dorobantu
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2007-11-09
Timisoara, RO
 

I’m trying to make it work in version 1.3.2.4, but without success.
If enabling the module by setting <active>true</active> in the xml, i get:

PHP Fatal error:  Class ‘Mage_Helloworld_Helper_Data’ not found in /Users/cosmindorobantu/Sites/auximus/magento/includes/src/__default.php on line 15928

If i try to enable the module via the admin, i get:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘default-0-advanced/modules_disable_output/Auximus_Helloworld’ for key 2

Any ideas on that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
hengman
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-07-21
 

Hello,

i got the same error. The solution in the following post solved my problem:

http://www.magentocommerce.com/boards/viewthread/72033/

Hope this helps,

grettings!

 
Magento Community Magento Community
Magento Community
Magento Community
 
cgfc
Sr. Member
 
Avatar
Total Posts:  92
Joined:  2008-08-29
Montevideo, Uruguay
 

I got the following error when click into an item from the list to edit:

Recoverable Error: Argument 1 passed to Mage_Adminhtml_Controller_Action::_addContent() must be an instance of Mage_Core_Block_Abstract, boolean given, called in \app\code\local\Test\test\controllers\Adminhtml\TestController.php on line 25 and defined in \app\code\core\Mage\Adminhtml\Controller\Action.php on line 112

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2