Mity Docs Mity Docs for Mity Digital
Variable Number Fieldtype Documentation

Installation

Requirements

The Variable Number Fieldtype requires:

  • Statamic 5

  • PHP 8.2 and later

  • intl extension

  • Alpine.js

If you do not use Alpine.js in your site, you can re-write the logic for the fieldtype to meet your JavaScript requirements.

For Statamic 5, please use 1.x, however note that it will no longer be maintained.

Installation

Install the Variable Number Fieldtype via composer:

1composer require mitydigital/statamic-variable-number-fieldtype

Layouts

While the fieldtype includes radio, select and button layouts, the layouts do not include fancy styles.

This is by design, and makes it faster (and easier) for you to add your own site's look-and-feel.

You will need to include these in your own project by publishing the Antlers files:

1php artisan vendor:publish --tag=statamic-variable-number-fieldtype-views

Logic

The logic for the frontend fieldtypes is written as an Alpine.js component, keeping the fieldtype layouts leaner. This will need to be included once in your form. See How to use for details on this.

If you do not need to make any changes to the fieldtype's logic, you can skip this step.

When you do want to make a change to the logic, you can publish the logic:

1php artisan vendor:publish --tag=statamic-variable-number-fieldtype-logic