Skip to main content
Version: 2023.3

Numeric Editable

General

The numeric editable is very similar to the input editable, but with special configurations for the use with numbers.

Configuration

NameTypeDescription
maxValuefloatDefine a maximum value
minValuefloatDefine a minimum value
widthintegerWidth of the field in pixel
classstringA CSS class that is added to the surrounding container of this element in editmode
requiredbooleanset to true to make field value required for publish

Methods

NameReturnDescription
getData()int,floatValue of the numeric field, this is useful to get the value even in editmode
isEmpty()booleanWhether the editable is empty or not

Examples

Basic Usage

{{ pimcore_numeric('myNumber') }}

Now you can see the numeric value in the editmode view Numeric input - editmodeNumeric input - editmodeNumeric input - editmode

Advanced Usage

In the following example we're going to use a minimal and maximum value as well as a decimal precision.

{{ pimcore_numeric('myNumber',{
"width" : 300,
"minValue" : 0,
"maxValue" : 100,
"decimalPrecision" : 0
})
}}

To display the number also in editmode, you can use the method getData()

<p>
{{ pimcore_numeric('myNumber').getData() }}
</p>