Installation
Requirements
The Variable Number Fieldtype requires:
Statamic 6
PHP 8.2 and later
intl
extensionAlpine.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.
3.x is available for Statamic 6.
2.x is available for Statamic 5, and is supported while Statamic support v5.
1.x is available for Statamic 4, however is no longer supported.
Installation
Install the Variable Number Fieldtype via composer:
1# for Statamic 62composer require mitydigital/statamic-variable-number-fieldtype:^3.03 4# for Statamic 55composer require mitydigital/statamic-variable-number-fieldtype:^2.0
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