I am having trouble creating a custom module for my Magento store.
I have successfully added a route (/landing), and created/layout files that display template content within my base layout. I now need to move beyond that a bit.
I want to be able to load a parameter from a URL, grab an object based on that parameter, and display things based on the contents of my object.
Example: User browsers to domain.com/landing/cool/. This (hopefully) would call the landing controller. Controller would somehow be able to pull the ‘cool’ parameter, and pull a landing object associated with cool. Then, my template can get that object and display its elements.
I know there are a lot of bits there, but I have been cracking my head on this for a while and getting nowhere. Magento has to do this for all its categories, items, etc. Does anyone out there know how I can do it?
If you do domain.com/landing/[controller]/cool/[key]/[value], you can do $this->getRequest()->getParam(‘[key]’) to get the value of [value]. You can then set the template based on that, but I think that’s a different question. Let me know if you’re still confused.