Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1115161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:07:01+00:00 2026-05-17T03:07:01+00:00

HI, I am trying to create a router for my custom module. I would

  • 0

HI,

I am trying to create a router for my custom module.

I would like to access index controller’s hotsale action by url/hotsale. So I create the following router xml in my module’s config.xml.

<hotsale>
 <use>standard</use>
 <args>
  <module>Moon_Products</module>
  <frontName>hotsale</frontName>
 </args>
</hotsale>

when I access url/hotsale, it goes to index controller’s index action. How do I make it to execute hotsale action?

I tried to add hotsale, but it didn’t work.

I took Alan Storm’s suggestion and ended with the following code.

public function indexAction()
{
    if($this->getRequest()->getRouteName() == 'hotsale'){

        $this->loadLayout();    

        $block = $this->getLayout()->createBlock(
            'Mage_Core_Block_Template',
            'my_block_name_here',
            array('template' => 'moon/hotsale.phtml')
        );


        $this->getLayout()->getBlock('root')->setTemplate('page/product-without-rightbar.phtml');
        $this->getLayout()->getBlock('content')->append($block);

        $this->renderLayout();

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T03:07:01+00:00Added an answer on May 17, 2026 at 3:07 am

    Default frontend/store routing works like this

    http://example.com/front-name/controller-name/action-name
    

    So, when you go to

    http://example.com/hostsale
    

    You’re really saying

    http://example.com/hostsale/index/index
    

    The front-name concept is a little abstract, but in practice is ties a URL to a particular module.

    So, if have an IndexController.php with a method named hotsaleAction, and you want to execute this method, use a URL in the form

    http://example.com/hotsale/index/hotsale 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a custom table using custom module. I have been
I'm trying to create a custom route like: search/result/city/p1/state/p2/zip/p3/min/p4/max/p5/bed/p6/bath/p7/cats/p8/dogs/p9/parking/p10 Where search is the controller
hi i am trying to create a URL that looks like this: black/granite/worktops where
I'm trying to create a custom action for a Update My Profile Page. It
I am trying to create a new custom module in magento but the layout
I have several links I'm trying to create to either perform custom controller methods
I'm trying to test a controller. Zend Tool has generated the following code: class
My application is trying to create custom objects from NSImage objects (coming from the
I'm trying to create a a custom post method but i'm having trouble finding
I am trying to create a URL shortener using CodeIgniter 2. I have 2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.