Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

magento Baseurl from helper function

Tags:

magento

I want to get custom URL from magento helper in this way:

<action 
  method="addLink" 
  translate="label title" 
  module="customer">
  <label>About Us</label>
  <url 
    helper="customer/getAboutUsUrl">
    about
  </url>
  <title>About Us</title>
  <prepare/>
  <urlParams/>
  <position>1</position>
</action>

So what I did is define a function getAboutUsUrl() under local directory within Customer Helper Directory. But it does not return the base url as I expected.

What do I have to do to get the baseurl with about us link?

Thanks

like image 736
Elamurugan Avatar asked Sep 27 '10 15:09

Elamurugan


1 Answers

You should use cms/page/getPageUrl helper method and pass CMS-page identifier as its parameter like in the following example:

<action 
  method="addLink" 
  translate="label title" 
  module="customer">
  <label>About Us</label>
  <url helper="cms/page/getPageUrl"><pageId>about</pageId></url>
  <title>About Us</title>
  <prepare/>
  <position>1</position>
</action>
like image 184
Ivan Chepurnyi Avatar answered Nov 14 '22 10:11

Ivan Chepurnyi