Magento2

Magento 2 System Configuration Field Types

Magento 2 System Configuration Field Types

Magento 2 system configurationĀ provides below fields type.

List Field Types :

  • button
  • checkbox
  • checkboxes
  • column
  • date
  • editablemultiselect
  • editor
  • fieldset
  • file
  • gallery
  • hidden
  • image
  • imagefile
  • label
  • link
  • multiline
  • multiselect
  • note
  • obscure
  • password
  • radio
  • radios
  • reset
  • select
  • submit
  • text
  • textarea
  • time

Yes/No Field :

Select (Drop down) Options :

Create Model file for drop down options

File Path : app/code/V4U/Helloworld/Model/Config/Source/SelectOptions.php

Select (Drop down) Options Multiple:

Create Model file for options

File Path : app/code/V4U/Helloworld/Model/Config/Source/MultiSelect.php

Textarea :

Datepicker :

For datepicker create block file.

File Path : app/code/V4U/Helloworld/Block/DatePicker.php

Note : If you want only Calendar then you can comment the code to remove time(Hour,Minute,Second).

File Path : app/code/V4U/Helloworld/Block/DatePicker.php

Line to comment :

Multiple Dates :

Create Model File :

File Path : app/code/V4U/Helloworld/Model/Config/Backend/DatePickerList.php

Create Adminhtml block file :

File Path : app/code/V4U/Helloworld/Block/Adminhtml/Form/Field/DatePickerList.php

Time Picker :

Button :

Create frontend model file.

File Path : app/code/V4U/Helloworld/Block/System/Config/Button.php

Create PHTML file

File Path : app/code/V4U/Helloworld/view/adminhtml/templates/system/config/custom_button.phtml

šŸ™‚ Happy Coding. Keep Liking & Sharing šŸ’»

Tagged ,