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

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