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

Developing new module - integrity in Admin + frontend
 
Dmitry A Nikolaev
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2007-10-29
Saint-Petersburg
 

Hi!
I developed new module that add new admin menu (and submenu).
Now it full url path is “/testmodule”

I wish that it path would be smth like “/admin/testmodule”
So I write some rewrite to config.xm smth like:

<rewrite>…
<from>…
<to>…

It’s works! But all default admin menu items has submenu address smth. like “*/address” in their configs, so all links in admin menu become smth. like “testmodule/[address]” (because url building depends on module name, name of current page module is “testmodule").
Is there way to make my module admin address like “admin/testmodule” and make all links in admin menu shows correctly ?

Second question - could I make both frontend controller & admin controllers in one module ?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dmitry A Nikolaev
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2007-10-29
Saint-Petersburg
 

Ok, thanks Moshe for private reply!
Seems like this future (integrating external modules in “/admin” namespace) will be realized in next release.

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

I think a way around his problem, (one which I now share) is to create a script in the 404 page that could check to see what page could not be found, and attempt to rewrite the address to be on the admin namespace.

For instance, if you clicked on the Sales Invoices link while inside a module name MyModule, then it would take you to magento/index.php/MyModule/sales_invoice/ which would break. This could be corrected by replacing everything from index.php/ to the following / with “admin” so that it would become magento/index.php/admin/sales_invoice/ and would then work.

The problem that I am having, is that I don’t know where the 404.php is located, nor whether the htaccess that does the redirect sends the 404 page the errored address. If not, we could easily add this, but would need to know where that htaccess file is. Can anyone help here?

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