1

How can I create a tooltip button in the configuration section of a custom module? Is it possible to use UI Components to define it?

What I'd like to achieve is for example

for the field defined in /etc/adminhtml/system.xml

        <field id="xml_filename" translate="label" type="text" sortOrder="15" showInDefault="1" showInStore="1" showInWebsite="1">
            <label>XML Filename</label>
        </field>

to add a hint

The file will be saved under directory ..... etc etc 

I haven't noticed any such hints in other default magento modules' configuration tabs for reference.

2 Answers 2

3

You can use <tooltip> tag for this.

<tooltip>The file will be saved under directory ..... etc etc</tooltip>

For example,

              <field id="test" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1">
                    <label>Test Textbox</label>
                    <tooltip>The file will be saved under directory ..... etc etc</tooltip>
                </field>

You can find in core magento from below path,

app\code\Magento\Paypal\etc\adminhtml\system\express_checkout.xml

Sample output

enter image description here

1
  • Thank you very much. It was a rookie mistake I didn't think to try the same way as magento 1.
    – gabtzi
    Commented Dec 6, 2017 at 15:50
3

You can either use Tooltip

<field id="xml_filename" translate="label" type="text" sortOrder="15" showInDefault="1" showInStore="1" showInWebsite="1">
    <label>XML Filename</label>
    <tooltip>The file will be saved under directory ..... etc etc </tooltip>
</field>

Or Comment

<field id="xml_filename" translate="label" type="text" sortOrder="15" showInDefault="1" showInStore="1" showInWebsite="1">
    <label>XML Filename</label>
    <comment>The file will be saved under directory ..... etc etc </comment>
</field>

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.