0

As in phtml file we use

<?php echo __('Title'); ?>

to Support Multi Language.

How to use same in XML File for Title

app\code\Custom\Module\view\frontend\layout\mymodule_index_index.xml

<referenceBlock name="breadcrumbs">
    <action method="addCrumb">
        <argument name="crumbName" xsi:type="string">Home</argument>
        <argument name="crumbInfo" xsi:type="array">
            <item name="title" xsi:type="string">Home</item>
            <item name="label" xsi:type="string">Home</item>
            <item name="link" xsi:type="string">{{baseUrl}}</item>
        </argument>
    </action>
</referenceBlock>
5
  • First you check your xml file name @AnkitShah, like this app\code\Custom\Module\view\frontend\layout\mymodule_index_index.xml Sep 16, 2016 at 6:30
  • @PayalPatel What's wrong?
    – Jackson
    Sep 16, 2016 at 6:42
  • Your xml file name here app\code\Custom\Module\view\frontend\layout\mymodule_inde_index.xml @AnkitShah Sep 16, 2016 at 6:46
  • 1
    Aahh. It's Type Mistake. Will update in question. Wait a min. Done
    – Jackson
    Sep 16, 2016 at 6:49
  • Okk. Fine @AnkitShah Sep 16, 2016 at 6:52

1 Answer 1

3
<referenceBlock name="breadcrumbs">
    <action method="addCrumb">
        <argument name="crumbName" xsi:type="string">Home</argument>
        <argument name="crumbInfo" xsi:type="array">
            <item name="title" xsi:type="string" translate="true">Home</item>
            <item name="label" xsi:type="string" translate="true">Home</item>
            <item name="link" xsi:type="string">{{baseUrl}}</item>
        </argument>
    </action>
</referenceBlock>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.