⧼vector-jumptocontent⧽

Email field: Difference between revisions

From EPrints Documentation
Added examples. Improved other sections unhide ToC.
Moved description to top
Line 1: Line 1:
{{fieldtypes}}
{{fieldtypes}}


== Description ==
This field works just like a text field except that
* it gives a validation error if it does not appear to be a valid email address
* when rendered it is rendered as a <tt>mailto:</tt> link to the email (unless the <tt>render_dont_link</tt> property is set).


== Inheritance ==
== Inheritance ==
* [[:Category:EPrints_Metadata_Fields|Metadata Field]]
* [[:Category:EPrints_Metadata_Fields|Metadata Field]]
** [[Id field]]
** [[Id field]]
*** [[Idci field]]
*** [[Idci field]]
**** [[Email field]]
**** [[Email field]]
== Description ==
This field works just like a text field except that
* it gives a validation error if it does not appear to be a valid email address
* when rendered it is rendered as a <tt>mailto:</tt> link to the email (unless the <tt>render_dont_link</tt> property is set).


== Properties ==
== Properties ==

Revision as of 08:23, 21 March 2023


Description

This field works just like a text field except that

  • it gives a validation error if it does not appear to be a valid email address
  • when rendered it is rendered as a mailto: link to the email (unless the render_dont_link property is set).

Inheritance

Properties

Same as Id field, except

name default description
render_dont_link 0 as for Metadata but actually applicable.

Required Phrases

No additional phrases.

Database

Email fields are stored in the database as

fieldname VARCHAR(255)

API

See API page.

Examples

Most basic example.

{
    name => "contact_email",
    type => "email",
}

Do not render the email address as a mailto: link.

{
    name => "user_email",
    type => "email",
    render_dont_link => 1,
}