How to add tooltip in a system configuration field.
Hello Friends!!!
In this blog, we are going to learn how we can add tooltips in a system configuration field.
For example, we have to create an input field and we want to add a tooltip with this field, then we can add our tip in <tooltip> tag in the system.xml file as follows:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd">
<system>
<tab id="webkul" translate="label" sortOrder="10">
<label>Webkul</label>
</tab>
<section id="custommodule" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Custom Module Configuration</label>
<tab>webkul</tab>
<resource>Webkul_Custommodule::config_custommodule</resource>
<group id="general" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General Settings</label>
<field id="customfield" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Aadhaar Number</label>
<validate>required-entry validate-sixteen-degit</validate>
<tooltip>It is unique Identification number</tooltip>
</field>
</group>
</section>
</system>
</config>
See the result in following image:
Hope this will be helpful. Thanks 🙂
Categories:
Magento 2
View Comments
Comment or Ask a Question
Quick Links