Config Fields M2 banner
netresearch netresearch

Config Fields M2

Development community

Description

A collection of custom config types for Magento 2 system configuration development.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Custom Config Fields for Magento 2

No more fiddly "Yes/No" dropdowns in your configuration.

This Magento 2 extension offers a selection of custom "Field Types" and "Frontend Models" for use in Magento 2 extensions with a system configuration section.

Features

Custom field types

  • Checkboxset: Functionally equivalent to native Magento field type multiselect
  • Radioset: Functionally equivalent to native Magento field type select
  • Checkbox: Functionally equivalent to native Magento field type select with YesNo source model
  • Toggle: Same as "Checkbox", but with special styling
  • TimeWithMinutePrecision: Works like the Magento field type time but hides the 'seconds' selection.

Custom frontend model blocks

  • InfoBox: A customizable information section for your extension

Installation via composer

Requires PHP 8.3, 8.4 or 8.5 and Magento 2.4.8 or 2.4.9.

composer require netresearch/config-fields-m2:*

Usage

In your Magento 2 extension's `etc/adminhtml/system.xml`, enter the class name of one of the Types at `Netresearch\ConfigFields\Model\Type`.

For example:


    Logging
    Record messages to Magento logs
    You must have global logging activated for this to work.


    Logging Level
    
        1
    
    Some\Module\Model\Config\Source\LogLevel
    The log level Debug may result in very large log files.

Custom frontend model blocks may use additional configuration values transmitted via `` nodes:

For example:


    Netresearch\ConfigTypes\Block\InfoBox
    Some_