Magento – Call helper method from cms template

cmshelpertemplate

Is it possible to call a helper method to output a variable in a cms template?

Similar in fashion to the way helpers can be called in layout files such as:

<node helper="myhelper/myhelpermethod" />

Maybe there is some way to do like:

{{module method="params"}}

which is similar to

{{store direct_url="about-magento-demo-store"}}

Best Answer

  1. Create a template (.phtml ) file and call your helper function there.

    Mage::helper('myhelper')->myHelperMethod();

  2. Then inside the CMS page call the template file

    {{block type="core/template" template="path/to/file/mytemplate.phtml"}}

Related Topic