开发者

How to set link is Mage::getBaseUrl for breadcrumbs in layout?

开发者 https://www.devze.com 2023-04-11 04:56 出处:网络
From layout, how can I set crumbInfo/link is Mage::getBaseUrl() for breadcrumbs? <layout version="0.1.0">

From layout, how can I set crumbInfo/link is Mage::getBaseUrl() for breadcrumbs?

<layout version="0.1.0">
    <contacts_index_index translate="label">
        <reference name="breadcrumbs">
            <action method="addCrumb">
                <crumbName>Accueil</crumbName>
   开发者_开发问答             <crumbInfo>
                    <label>Accueil</label>
                    <title>Accueil</title>
                    <link>/</link><!--How can I set Mage::getBaseUrl() here-->
                </crumbInfo>
            </action>
            <action method="addCrumb">
                <crumbName>Contactez-nous</crumbName>
                <crumbInfo>
                    <label>Contactez-nous</label>
                    <title>Contactez-nous</title>
                </crumbInfo>
            </action>
        </reference>
    </contacts_index_index>
</layout>


If you want to use URL in layout XML then Try this that will work everywhere :

<link>{{baseUrl}}</link>
<link>{{baseSecureUrl}}</link>
<!-- Using Identifier -->
<link>{{baseUrl}}some-identifier</link>

Basically when Mage_Core_Model_Layout_Update constructor call that will parse {{baseUrl}} and {{baseSecureUrl}}.

These will work for all layout file.


For argument nodes in layout XML, you can specify a helper and method; the return value of the method will be passed as the argument.

In your xml above, you can pass <link helper="class_group/classname/method" /> and create a helper to return the URL value that you like.


The only working method to do this seems to be using <link>{{baseUrl}}</link> as you can read in this link.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号