Dataformfield text

From MoodleDocs


Allows the user to enter single-line text.

File:df-field-text-edit.png

Features

Settings

General settings

Name

Short name for the field. Since the field name is used in field patterns, long convoluted names may make the view template less readable.

Description

Short description of the field purpose and characteristics to allow managers to see at a glance what each field is intended for. This description is displayed only in the field management list.

Visibile

To whom the field (label and content in browse and editing modes) is visible when displaying entries (in views that contain the field pattern).

  • Managers only - Users with manageentries capability.
  • Owner and managers - Users with manageentries capability and the entry author.
  • Everyone - All users.

Editable

Whether the field content can be updated by an entry author without manageentries capability.

Template

The field template allows for creating a complex display of the field content by interpreting patterns of the field if included in the template. For example, with a number field called Number and the field template defined as 'You have earned [[Number]] credits.' and an entry where the number value is 47 the pattern [[Number@]] would be displayed as 'You have earned 47 credits.' The field template can also be used as a simple label for the field (rather than labels as static content in the view template) with the advantage that it observes the field visibility and is hidden if the field is set to be hidden. The field template can be added to the view by means of the [[fieldname@]] pattern.


Field specific settings

Auto link

Whether to field content should be auto-linked by the Dataform auto linking filter.

Width

The width of the input text box in editing mode. Width units can be px, em or %.

Format

The allowed format of the entered text in editing mode:

  • Alpha-numeric - The input must contain only letters and numbers.
  • Letters only - The input must contain only alphabetic characters.
  • Numeric - The input must contain a valid positive or negative integer or decimal number.
  • Email - The input must be a likely syntactically valid e-mail address.
  • No-punctuation - The input must not contain any of these characters: ( ) . / * ^ ? # ! @ $ % + = , " ' > < ~ [ ] { }.

Number of characters

The allowed number of characters in the entered text in editing mode:

  • Minimum - The input can be at most N characters.
  • Maximum - The input must be at least N characters.
  • Range - The input must be between N-min and N-max characters (inclusive).

Patterns

Common field patterns

[[fieldname@]]

Displays the field label/template.


Field specific patterns

[[fieldname]]

Displays input text box in editing and the entered text in browsing.

Sort / Search

The following field elements are available for defining sort and search criteria in Dataform Filters:

Sort

  • Content – The textual content of the field.

Search

  • Content – The textual content of the field.

Import / Export

Settings

  • Name – The heading of the corresponding column in the csv import file. Defaults to the pattern name.

Content

Depending on the imported pattern.