You are here: Administrators Reference > Site Administration > Elements & Forms > Field Types and Masks > Custom Field Type State > Add Field Type

 

Add Field Type

CommonSpot offers over 20 field types out of the box for use in Simple Forms and for collecting metadata and Custom Element data. In addition to standard field types, you can register your own Custom Field Types and make them available through the same interface as CommonSpot standard types.

To create a new Field Type click Add New Field Type in the Field Types and Masks dialog.

The Add Field Type dialog displays.

Mouseover to view larger

The dialog prompts for Field Type name and description, as well as Property and Render Module. Property Modules control display of information requested in the Other Properties tab. You can use any of the existing Property Modules or pre-built CommonSpot fields, or you can specify a custom script that prompts contributors for specific properties.

A render module is a custom script module for defining output for the new field type on the metadata form, simple form, or custom Element form. How this field looks is up to the developer. For more information on creating custom Property and Render Modules for Custom Field Types, see the Custom Field descriptions in the CommonSpot Developer's Guide and the Command API Reference.

This dialog displays the following options:

Name: The name of the Field Type displayed in all the Form Creation dialogs.

Description: A short description for the Field Type

Property Module: Select one of the currently available field types (Selection List, Checkbox, Text area, etc…) from the dropdown or select Custom Property Module to view a dropdown of already defined custom types.

Select Explicit Property Module to specify a path for the new type.

Note: The default location for all Property Modules for Custom Field Types is in /<<siteroot>>/customfields/.

Render Module:All Render Modules are custom modules that must reside in the /<<siteroot>>/customfields/ directory. Select existing custom render modules from the dropdown, or click Explicit Render Module to specify a path for the new module.

Data Type: Controls how CommonSpot processes custom field type data for rendering and editing. You can adjust this setting for each of your custom field types to control display on output. See Text Handling in CommonSpot for more information.

These options affect how HTML data is handled.

The following native HTML characters must be escaped - that is, converted to their HTML equivalents - in content being edited to prevent interference with form processing. For example, without escaping double quotes entered in a text input control, the browser interprets the first one as the end of the field's value attribute, cutting off everything entered after that or dumping content outside the text field.

Escaping also allows the correct rendering of content that includes HTML-like data. For example, without escaping, browsers suppress <characters> contained within tag delimiters as unknown HTML.

CommonSpot gives you the following options for handling HTML data in custom fields:

Newlines are converted to HTML<br> tags, so text moves to the next line, as it would in plain text.

Multiple spaces are converted to alternating non-breaking-space/space pairs, so they create additional space.

These behaviors are unlike plain HTML, where any amount of consecutive whitespace, including newlines, collapses down to the visual equivalent of one space. Page authors may find this more intuitive than having to type <br /> tags or &nbsp; to achieve these common effects. This is similar to the way Simple Text Block elements are handled.

 

Related Links


You can download PDF versions of the Content Contributor's, Administrator's, and Elements Reference documents from the support section of paperthin.com (requires login).


For technical support:

http://www.paperthin.com/support/