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
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 ;)
-
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– odd_duck2017年01月30日 13:41:22 +00:00Commented Jan 30, 2017 at 13:41
-
Use /our-work/digitalwork instead of /our-work/digital-workKonrad Siamro– Konrad Siamro2017年01月30日 13:50:34 +00:00Commented 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 seeodd_duck– odd_duck2017年01月30日 13:53:34 +00:00Commented Jan 30, 2017 at 13:53
-
1Or 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 ;)Konrad Siamro– Konrad Siamro2017年01月30日 13:55:15 +00:00Commented Jan 30, 2017 at 13:55
Explore related questions
See similar questions with these tags.