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

How do I add another page / database to module? (Used module creator to get started)
 
ShopGuy
Guru
 
Total Posts:  462
Joined:  2008-09-07
 

Okay, I am trying to figure out how to create modules. I used the module creator found here:

http://www.magentocommerce.com/wiki/custom_module_with_custom_database_table

My module namespace / name is Xyz_News. It is found in /local/Xyz/News/

I have customized the database and form to fit my needs so I can view / add / remove news items from the database using the Magento backend. Now, this is where I am stumped:

The probem

I want to create another database table related to news and manage it. The table would be “news_sources” This is what I have figured out:

1) How do add an additional menu item in the backend “Manage News Sources”

I know, short list. I have copied everything in the /local/Xyz/News/ folder and changed “News” to Sources. So, for example, in addition to /local/Xyx/News/Model/News.php I have /local/Xyz/News/Model/Sources.php too.

And, in addition to the model class Xyz_News_Model_News I have Xyz_News_Model_Sources.

However, none of these files seem to be getting picked up by magento. So, when I go to:

http://www.mystore.com/index.php/news/adminhtml_news_sources/ I get a 404 error

Can anyone shed some light on this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brilliand
Member
 
Total Posts:  34
Joined:  2008-08-29
 

I had the same problem… this probably results from not having a SourcesController in the news/adminhtml/news/ directory.  In my case, I wanted my URL to be adminhtml/salesreps, so I had to add a SalesrepsController to the Adminhtml core folder.  (bleh)

Does anyone know of a way that I can use the adminhtml/salesreps URL without adding anything to the core?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top