FieldtypeDimension by soma

Field that stores 3 integer values for width/height/depth.

Dimension Fieldtype

What it does


This fieldtype let's you define 3 dimensions width / height / depth as integer.

Output the values in templates

There's a property for each dimension

echo $page->fieldname->width;
echo $page->fieldname->height;
echo $page->fieldname->depth;

There's also support for a computed value of the volume. WHD. This will get stored additionally to the database and updated every time a dimension value changed. So it can also be used in selectors for querying.

echo $page->fieldname->volume;

Use in selectors strings

The dimensions can be used in selectors like:

$pages->find("dimension.width=120");

or

$pages->find("dimension.height>=100, dimension.depth<120");

or

$pages->find("dimension.volume>=1000");

Field Settings

  • There's field settings for the width of the inputs in pixels.
  • There's a input setting to add a suffix string to each input like "mm" or whatever you like.

How to install


  1. Download and place the module folder named "FieldtypeDimensions" in: /site/modules/
  2. In the admin control panel, go to Modules. At the bottom of the screen, click the "Check for New Modules" button.
  3. Now scroll to the FieldtypeDimension module and click "Install". The required InputfieldDimension will get installed automatic.
  4. Create a new Field with the new "Dimension" Fieldtype.

Support thread


http://processwire.com/talk/topic/4081-fieldtypedimension/

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Twitter updates

  • There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new—More
    20 November 2020
  • ProcessWire 3.0.168 core updates — More
    26 October 2020
  • This week a 2nd new module for processing Stripe payments has been added to FormBuilder. Unlike our other Stripe Inputfield, this new one supports 3D Secure (SCA) payments. We’ll take a closer look at it in this post, plus a live demo— More
    16 October 2020

Latest news

  • ProcessWire Weekly #342
    In the 342nd issue of ProcessWire Weekly we're going to check out brand new admin theme called Admin Theme Canvas, a new module called MatomoWire, latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 28 November 2020
  • New ProcessWire modules directory
    There’s a new modules directory on the ProcessWire site now up and running. In this post we’ll cover a few details about what’s changed and what’s new.
    Blog / 20 November 2020
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer