Measured Value Field
MVF module implements CCK field that has number and unit of measurement. MVF supports both single values, and value ranges, where each range is pair of values that is treated like single value of field (i.e. field can have many ranges).
MVF module uses the Units module API, to get a list of units to work with. Thanks to this flexibility MVF can be used to setup: distances, weights, currencies, percentages, speeds, calories... list is endless.
Measured Value Field module was started as fork of Money CCK module, but provides more generic and flexible solution.
Everything Money CCK could do is implemented, besides converting facility, which is not in my priority list. Compared to Money CCK there are lots of advancements: value range support, pluggable units support, flexible validation of values, min-max limits, easy setup of available units.
Technical Details
The form element for values is reused from the Formatted Number CCK module. Decimal points and thousands separators are formatted using the Format Number API module, where these options are configured from site and/or user settings.
Single values are stored as pairs too: just their "To" value is equal to the "From" one.
For ranges there are also advanced Views filters implemented: you can filter using range overlap, and "in between" filter operator is aware of the range.
Requirements
CCK, Units, Format Number, Formatted Number
Also you need one or more Units integration modules, that implements unit types.
Integration
Same as Money CCK module, Measured Value Field integrates with Views, Diff and Token modules.
Installation and Usage
- Install and enable all required modules and MVF itself
- For maximum comfort, goto "Administer > Content management > Units" and setup
site-wide list of enabled units. This will save you lot of time, because each MVF instance will use globally enabled units as a base. - Create or edit content types and start adding Measured Value Fields.
Important: when upgrading MVF module, it's recommended also to install latest version of Units.
Current Status
This module was not deeply tested and not yet ready for production use. It works for me but may contain bugs.
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.0-beta1 | 2009-Sep-04 | 15.76 KB | Download · Release notes | Recommended for 6.x | |
| Development snapshots | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.x-dev | 2009-Sep-03 | 15.76 KB | Download · Release notes | Development snapshot | |
