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

What does frontName> do? 
 
Periculi
Sr. Member
 
Total Posts:  249
Joined:  2009-02-03
 

I am curious about the config.xml use of <frontName> for <admin>.

Could someone explain this please.

And perhaps explain why removing it from the Lazzymonk blog extension fixed having the category links send users to the admin login screen, too.

Please.

 
Magento Community Magento Community
Magento Community
Magento Community
 
piotrn
Member
 
Total Posts:  33
Joined:  2008-04-27
 

When you add a new module, adding <frontName> decalration, enables you to use different name in url, then actual module name.

Example 1 (normal case):
Suppose I added a new module, say named: Example,
that module has a controller, named IndexController, default action is naturally called indexAction.
Lets also assume our domain is example.void
Now, if i would like to request default action of default controller for my new module, the url would look like that:
http://example.void/Example/index/index

Example 2 (with front name):
Lets take all the assumptions from Example 1, but say, I want user to see my module as Cool, instead of just the boring ExampleOne.
So now, I would add few more lines to the config.xml file:

<routers>
            <
Example>
                <use>
standard</use>
                <
args>
                    <
module>Example</module>
                    <
frontName>Cool</frontName>
                </
args>
            </
Example>
 </
routers>
Now, the url would look like this:
http://example.void/Cool/index/index

The position of the routers node in xml depends on type of your module.

 
Magento Community Magento Community
Magento Community
Magento Community
 
AITOC
Guru
 
Avatar
Total Posts:  618
Joined:  2009-02-19
US
 

PiotrN, great answer!  A real life sample are extensions.  Authors HAVE TO give a unique name to their extensions, smth like aitoneclickorder.  But using frontName they can provide a clean name for displaying.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Periculi
Sr. Member
 
Total Posts:  249
Joined:  2009-02-03
 

That’s not quite what I asked about, but thanks.

What is the difference between using this:

<admin>
        <
routers>
            <
blog>
                <use>
admin</use>
                <
args>
                    <
module>Monk_Blog_Manage</module>
                    
                </
args>
            </
blog>
        </
routers>
    </
admin>

And this:

<admin>
        <
routers>
            <
blog>
                <use>
admin</use>
                <
args>
                    <
module>Monk_Blog_Manage</module>
                    <
frontName>blog</frontName>
                </
args>
            </
blog>
        </
routers>
    </
admin>

Other than the fact that the former works in 1.3.x and the latter creates problems.

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