cancel
Showing results for 
Search instead for 
Did you mean: 

load magento module template

load magento module template

For a module I need to load template file and let it replace the complete page.
It is a XML file (but could also be any content whatsoever).
Generally speaking when

  • MYNS_MYMODULE_controllernameController

is triggered and calls

  • fooAction()

I need to be able to display a clean site with the content from my template file.

I'd prefer a solution where I don't have to pay attention to any templates and styles, because for the module functionality there are no real templates needed except for the one I want to implement.

Please let me know where to place the template file and how to tell magento to load this file as a root template without anything else around. If you need anymore information please let me know I will answer ASAP.

P.S. I did ask the same question on Stackoverflow if you prefer to gain reputation there.

3 REPLIES 3

Re: load magento module template

 

To clarify it even more:

For:
http://domain.tld/modulename/controller/action/

Where do I have to place template files and how should I reference them?

Still stuck

Re: load magento module template

I got an answer on StackOverflowfor anyone interested, it at least provides a quick way to get it done.
If somebody still cares to give a quick explenation or link to a tutorial which explains what to put into to which xml and where to place the files, this would still be very welcome.

Re: load magento module template

Hello jackprince1983,

 

You should read Magento doc and Alan Storm Blog. Alan also wrote a book about Magento Layout: No Frills Magento Layout.

 

Your url: http://domain.tld/modulename/controller/action/

 

The modulename_controller_action Handle is created by combining the route name (modulename), Action Controller name (controller), and Action Controller Action Method (action) into a single string. This means each possible method on an Action Controller has a Handle associated with it.

In your layout xml handles this request:

 

<modulename_controller_action>

......

</modulename_controller_action>

 

Hope my suggestion is useful for you.

Problem solved? Click Accept as Solution!