0

I have setup a custom module in my magento store (CE-1.9.0.0) with the following in my config file:

<?xml version="1.0"?>
<config>
    <modules>
        <Company_Custom>
            <version>0.1.0</version>
        </Company_Custom>
    </modules>
    <frontend>
        <routers>
            <custom>
                <use>standard</use>
                <args>
                    <module>Company_Custom</module>
                    <frontName>our-work/digital-work</frontName>
                </args>
            </custom>
        </routers>
        etc...

I know that when I have setup custom modules before the frontname works when it is a single string (i.e if I wanted to use just digital-work this works, just not when I have a nested string in place as in our-work/digital-work - this results in a page not found.

I am new to routers and magento so I presume I have misinterpreted what is possible in the <frontName> Is it possible to have a nested frontname?

1 Answer 1

0

If you want to have result in page You have to create Controllers in Your module.

It helps me a lot with understanding how routes works in Magento :
http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-3.html

Anyway You can try use Magicento1 for create controllers ;)

4
  • Thank you for the link - that definitely helps. So now I can successfully create another Controller within my controllers folder in my module (i.e digitalController.php which gives me the url .../our-work/digital but when I change the controller to digitalWorkController.php and navigate to .../our-work/digital-work I get a 404.
    – odd_duck
    Jan 30, 2017 at 13:41
  • Use /our-work/digitalwork instead of /our-work/digital-work Jan 30, 2017 at 13:50
  • There's no way of having the hyphen in then? I have been asked to have this in for SEO you see
    – odd_duck
    Jan 30, 2017 at 13:53
  • 1
    Or use /our-work/digital-work as route name and create IndexController.php with indexAction. "index' You can miss in url. I'm not sure You can use /our-work/digital-work in route name. However You are always able to set rewrites ;) Jan 30, 2017 at 13:55

Your Answer

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

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