About Dimension Fieldtype

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

Category 1Field Types
Fieldtype modules that represent a data type used by fields.
Category 2Input Fields
Inputfield modules that provide a UI input widget in the ProcessWire admin.
Release StateBeta
Close to stable, but users are advised to be cautious and test thoroughly.*
Authorsoma
Module Version1.0.3
Class NameFieldtypeDimension
Compatibility2.1, 2.2, 2.3, 2.4
Date AddedJuly 18, 2013
Recommended ByNew recommendations may take up to 1 day to appear.

Instructions

This module's files should be placed in /site/modules/FieldtypeDimension/
How to install or uninstall modules

README

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 additionallyto 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 thescreen, 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/

Comments

No comments yet. Be the first to post!

Post a Comment

Your e-mail is kept confidential and not included with your comment. Website is optional.