Hello Magento Friends,
Today I am here with a new Magento 2 solution. Today it’s about How to Create a Password or an Encrypted Field in Magento 2 System Configuration.
You might need to add a password field in the system configuration where the input type is abstruse, meaning the data is not shown as text. To create a password type field in the system configuration, perform the below step.
Contents
Step 1: First, create a system.xml file at the below path
app\code\Vendor\Extension\etc\adminhtml
We use the “obscure” field type and Magento\Config\Model\Config\Backend\Encrypted as the backend_model.
In the file app/code/Vendor/Extension/etc/adminhtml/system.xml add a new field as below:
<field id='encrypted_password' translate='label' type='obscure' sortOrder='3' showInDefault='1' showInWebsite='1' showInStore='1'> <label>Password</label> <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> </field>
Now, you can find that the password field is added to the admin system configuration with encrypted input. When you input any data, it will be shown as dots.
This way, you can add a password-like field or an encrypted field in Magento 2 system configuration.
Moreover, you can create the following fields in the Magento 2 system configuration:
Also, perform the following actions on Magento 2 system configuration field:
Share this tutorial with your friends and stay updated for more!
Happy Coding!
In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…
In the world of business, understanding financial metrics is crucial for making informed decisions and…
Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…
In this era, businesses are always on the lookout for ways to engage with their…
Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…
E-commerce has transformed the way consumers shop for products and services and interact with businesses.…