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 the following field type providers:

Provider

Used for

Comments

AdvancedXmlDataProvider

 

 

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 using values from other fields

The format used in the calculation is:

[{FieldSystemName1}] some text [{FieldSystemName2}]

For example:

[<b>{ProductName}</b>] is currently not in stock! It is expected back in stock {ProductExpectedDelivery}

Fetch product category content:

[ProductCategory|equipment|Gear}]

Use Display type and Use listbox content settings to further control how and what is rendered.

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

TemperatureFieldTypeProvider

Specifying a temperature unit – F, C og K – to use on each Ecommerce language

  1. Specify the number of decimals
  2. For each language select a 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.