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?

asked Jan 30, 2017 at 12:08

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 ;)

answered Jan 30, 2017 at 12:12
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. Commented Jan 30, 2017 at 13:41
  • Use /our-work/digitalwork instead of /our-work/digital-work Commented 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 Commented 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 ;) Commented Jan 30, 2017 at 13:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.