Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Choosing datatypes for your fields

Which of the 35 shipped datatypes to choose for each kind of field - text, rich text, dates, numbers, choices, relations, media, prices, users - with what each stores and how it is shown.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/website-creators/choosing-datatypes.md

On this page

Choosing datatypes for your fields

This page is for website creators who add attributes to classes. A datatype decides how a field is edited, stored, validated, searched and shown, and it cannot be changed later without migrating data. Choose by what you will do with the value.

A class's page: its attributes, each with its datatype, identifier and whether it is required, searchable or translatable
A class's page: its attributes, each with its datatype, identifier and whether it is required, searchable or translatable

Contents

  1. The shipped datatypes
  2. Choosing by need
  3. Datatypes from extensions
  4. Showing a field in a template
  5. Pitfalls

The shipped datatypes

The datatypes available for new attributes are AvailableDataTypes[] in settings/content.ini; the shipped list has 35 entries:

GroupDatatypes
Textezstring (Text line), eztext (Text block), ezxmltext (Rich text), ezidentifier, ezisbn
Dates and timesezdate, ezdatetime, eztime
Numbers and yes/noezinteger, ezfloat, ezboolean
Choicesezselection, ezenum, ezcountry, ezkeyword
Relationsezobjectrelation (one object), ezobjectrelationlist (several)
Mediaezimage, ezbinaryfile, ezmedia
Contact and linksezemail, ezurl, ezauthor
Structuredezmatrix (a table)
Shopezprice, ezmultiprice, ezoption, ezmultioption, ezmultioption2, ezrangeoption, ezproductcategory
Systemezuser, ezsubtreesubscription, ezinisetting, ezpackage

The implementations are in kernel/classes/datatypes/<name>/.

Choosing by need

You needChooseNot
A title, a nameezstringezxmltext
A teaser or summary shown in lists and meta tagseztextezxmltext (markup in meta tags)
A body with headings, links, embedded imagesezxmltext (edited with the online editor)eztext
A date to sort or filter byezdate or ezdatetimetext
A yes/no switch (featured, hide teaser)ezbooleana selection with two items
One or several choices from a fixed listezselectionfree text
A countryezcountryezselection with your own list
An image used onceezimage in the class
An image reused in many placesezobjectrelation to an Image objecta copy in each object
Several related items (authors, related articles)ezobjectrelationlista text list of names
A downloadezbinaryfile
A link to another siteezurltext
An e-mail addressezemail (validated)ezstring
A table of valuesezmatrixrich text tables, when the values are data
Free keywordsezkeyword, or better eztags from the eztags extension
A priceezprice (with VAT) or ezmultiprice (several currencies)ezfloat

Datatypes from extensions

Extensions add datatypes; they register them in their own settings. Examples documented here: eztags (a tag tree with autocomplete), enhancedselection2, enhancedezbinaryfile, ezgmaplocation (a map location), ezstarrating. A datatype of your own is an application creator's task (Writing a custom datatype).

Showing a field in a template

{attribute_view_gui attribute=$node.data_map.body}

renders the field with its datatype's view template (content/datatype/view/<datatype>.tpl, overridable). For a plain value, read .content or test .has_content:

{if $node.data_map.image.has_content}
  {attribute_view_gui attribute=$node.data_map.image image_class='medium'}
{/if}

Pitfalls

  • Rich text where plain text is needed. Teasers in rich text end up as markup in feeds and meta tags.
  • Numbers as text. Text sorts "10" before "9".
  • Selections for things that change. Adding an option is easy; renaming one renames it in every object, and removing one leaves objects without a value. For a list editors maintain, use tags or relations.
  • Copies instead of relations. A copied image or address must be updated in every copy.
  • Old media datatypes. The Flash, QuickTime, Windows Media and RealVideo classes of older packages show content modern browsers do not play; use video files or embeds.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x