Field types

Dynamicweb is born with a set of standard field types for creating custom fields such as product fields, product category fields, or order fields – they are:

Field type

Function

Text (5-255)

Standard text field where you can type between 5 and 255 characters

Editor

Inserts a WYSIWYG editor where you write a text using various text editing tools.

Long text

Inserts a text box where you can type several thousand characters.

Checkbox

Inserts a checkbox

Date

Inserts a drop down where a date can be selected

Date/time

Inserts a drop down where a date and time can be selected

Integer

Inserts a field where integers can be entered

Decimal number

Inserts a field where decimal numbers can be entered

Link

Inserts a field where you can enter a link to another web page or a file in your File Manager

File Manager

Inserts a field where you can select a file from your File Manager

List box

Inserts a list of options that can be selected/deselected. List type & options must be defined.

In more advanced scenarios you can also create custom field types – these field types allow you to attach a provider to them, a piece of extension code which can be used to e.g. automatically convert from inches to millimeters (Figure 2.1).

Figure 2.1 The LengthFieldTypeProvider in action

To create a custom field type:

  • Go to Settings > Ecommerce > Product Catalog > Field Types
  • Click New in the toolbar and Name the field
  • Select a field type provider

By default, Dynamicweb comes with six custom field type providers. Three of these – the Length-, Volume- and WeightFieldTypeProvider – can be used to select a specific unit of measurement for each Ecommerce language. If you need more flexibility you can use the UnitsFieldTypeProvider to define custom units and conversion factors.

The CalculationProvider and the ConcatProvider are used to calculate field values and generate text based on values in other fields.

Provider

Used for

Comments

CalculationProvider

Calculating a number value based on other field values

The format used in the calculation is:

 

[{FieldSystemName1} * 0,8 + {FieldSystemName2}]

 

For example:

 

[{ProductPrice} * 2 + {ProductNumber}]

ConcatProvider

Generating a text value based on other field values

The format used in the calculation is:

 

{FieldSystemName1} some text {FieldSystemName2}

 

For example:

 

{ProductName} is currently not in stock! It is expected back in stock {ProductExpectedDelivery}

UnitsFieldTypeProvider

Creating custom unit types and defining how to convert between them

  1. Name each unit
  2. Specify a factor for converting between them – e.g. mm=1, cm=10,

LengthFieldTypeProvider

Specifying the preferred length unit per Ecommerce language from a predefined list of units

  1. Specify number of decimals
  2. Select a predefined unit
  3. Save

VolumeFieldTypeProvider

Specifying the preferred volume unit per Ecommerce language from a predefined list of units

  1. Specify number of decimals
  2. Select a predefined unit
  3. Save

WeightFieldTypeProvider

Specifying the preferred weight unit per Ecommerce language from a predefined list of units

  1. Specify number of decimals
  2. Select a predefined unit
  3. Save

Once a field type has been created, you can select it when creating custom product and category fields.