我希望以这种方式从magento帮助程序获取自定义URL:
<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>
Run Code Online (Sandbox Code Playgroud)
所以我所做的是getAboutUsUrl()
在Customer Helper Directory中的本地目录下定义一个函数.但它并没有像我预期的那样返回基本网址.
我需要做些什么来获得关于我们链接的baseurl?
谢谢
您应该使用cms/page/getPageUrl
帮助方法并将CMS页面标识符作为其参数传递,如下例所示:
<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>
Run Code Online (Sandbox Code Playgroud)