Jump to content

Email field: Difference between revisions

From EPrints Documentation
m Reverted edit of OyeLao, changed back to last version by Moj
 
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{fieldtypes}}
{{fieldtypes}}
__NOTOC__
== Inheritance ==


* [[Metadata]]
** [[Text field]]
*** [[Email field]]


== Description ==
== Description ==
This field works just like a text field except that  
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
* 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).
* 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 ==
== Inheritance ==
* [[:Category:EPrints_Metadata_Fields|Metadata Field]]
** [[Id field]]
*** [[Idci field]]
**** [[Email field]]


As for [[text field]]s.
== Additional Properties ==
Same as [[Idci field#Additional_Properties|Idci fields]] except for:
{| border="1" cellpadding="3" cellspacing="0"
! Name !! Default Value !! Required || Description || Notes
|-
| '''render_dont_link''' || <tt>0</tt> || NO || Whether to render the email address as a mailto link. || As for [[Metadata]] but actually applicable.  
|-
|}


== Required Phrases ==
== Required Phrases ==
No additional phrases beyond those required for [[Idci field#Required_Phrases|Idci fields]].
== Database ==
Email fields are stored in the database as
fieldname VARCHAR(255)
== API ==
See [[API:EPrints/MetaField/Email|API page]].


none.
== Examples ==
Most basic example.
{
    name => "contact_email",
    type => "email",
}
Do not render the email address as a <tt>mailto:</tt> link.
{
    name => "user_email",
    type => "email",
    render_dont_link => 1,
}

Latest revision as of 21:29, 11 April 2023


Description[edit]

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[edit]

Additional Properties[edit]

Same as Idci fields except for:

Name Default Value Required Description Notes
render_dont_link 0 NO Whether to render the email address as a mailto link. As for Metadata but actually applicable.

Required Phrases[edit]

No additional phrases beyond those required for Idci fields.

Database[edit]

Email fields are stored in the database as

fieldname VARCHAR(255)

API[edit]

See API page.

Examples[edit]

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,
}