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 Commented Sep 16, 2016 at 6:30
  • @PayalPatel What's wrong?
    – Jackson
    Commented Sep 16, 2016 at 6:42
  • Your xml file name here app\code\Custom\Module\view\frontend\layout\mymodule_inde_index.xml @AnkitShah Commented Sep 16, 2016 at 6:46
  • 1
    Aahh. It's Type Mistake. Will update in question. Wait a min. Done
    – Jackson
    Commented Sep 16, 2016 at 6:49
  • Okk. Fine @AnkitShah Commented 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 you have read our privacy policy.

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