i want to show custom url parameter in page created via module

what is did i created a module to show page with custom page

issue is how to pass and show parameter in url like product id of parent product

With my module i am able to open url with dummy content: like below


i want to pass and show parameters like


Below is code of my module MY_Related

1: app\code\local\MY\Related\Block\Index.php

class MY_Related_Block_Index extends Mage_Core_Block_Template{   


2: app\code\local\MY\Related\controllers\IndexController.php

class MY_Related_IndexController extends Mage_Core_Controller_Front_Action{
    public function IndexAction() {

            $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
      $breadcrumbs->addCrumb("home", array(
                "label" => $this->__("Home Page"),
                "title" => $this->__("Home Page"),
                "link"  => Mage::getBaseUrl()

      $breadcrumbs->addCrumb("titlename", array(
                "label" => $this->__("Titlename"),
                "title" => $this->__("Titlename")



3: app\code\local\MY\Related\etc\config.xml

<?xml version="1.0"?>

4: app\code\local\MY\Related\Helper\Data.php

class MY_Related_Helper_Data extends Mage_Core_Helper_Abstract

2 Answers 2


try related/index/index/product/11. Then you should be able to read the product param like this:

$product = Mage::app()->getRequest()->getParam('product');
  • what to do if i do not need double index/index
    – mdeveloper
    Jun 14, 2016 at 12:42
  • then you need to create a custom router. take a look at this and try to adapt the answer to your needs.
    – Marius
    Jun 14, 2016 at 12:44
  • can you help how can it be fixed using router
    – mdeveloper
    Jun 14, 2016 at 12:47

To get all the parameters from the url related/index/index/product/11/id/4 then you can use this:

$product = Mage::app()->getRequest()->getParams();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.