Contact Form - Shortcodes

From e107 Wiki
Jump to: navigation, search

e107 Wiki: English | Русский | Deutsch | Français | Magyar | Português | Български | Česky | Nederlands | Ελληνικά | Italiano | Norske | Polska | Slovenščina | Español | Svenska | Translate: Wiki | Page

logo_wiki.png

Current Release 1.0.4 | e107.org | Download | Changelog | Forum | Plugins | Themes | RSS Feed of Latest Changes | Atom Feed of Latest Changes


e107 Shortcode Guide
Main page > I : First Aid > II : Development > III : Administration > IV : How To's > V : Plugin Writing > VI : Theming & Shortcodes



Contents

Overview

This page details the shortcodes used by the Contact Form plugin.

Shortcode Parameters

Shortcode parameters are passed to the shortcode using name/value pairs.

Each pair is separated by & and name/values are separated by =. If a parameter does not require a value, e.g. it switches something on or off, then just omit the value part.

Code: Shortcode parameter syntax
// Single parameter, no value
{CONTACTFORM_SUBJECT=param1}

// Single parameter with value
{CONTACTFORM_SUBJECT=param1=value1}

// Multiple parameters, param1 has no value
{CONTACTFORM_SUBJECT=param1&param2=value2}


Shortcodes

CONTACTFORM_SEND_TO

The drop down list of e-mail recipients (set up in the Contact Form admin pages).

Parameters:

label - display the label
divider - HTML used to separate the label from the field
field - display the field
readonly - don't display the field, instead create a hidden field that is submitted with the form. For this to work, there must only be one valid e-mail address in the drop down list.
Code: example
{CONTACTFORM_SEND_TO=label&field&divider=</td><td>}

CONTACTFORM_YOUR_NAME

Text field for the sender to enter their name.

Parameters:

label - display the label
divider - HTML used to seperate the label from the field
field - display the field
Code: example
{CONTACTFORM_YOUR_NAME=label&field&divider=</td><td>}

CONTACTFORM_YOUR_EMAIL

Text field for the sender to enter their e-mail address.

Parameters:

label - display the label
divider - HTML used to separate the label from the field
field - display the field
Code: example
{CONTACTFORM_YOUR_EMAIL=label&field&divider=</td><td>}

CONTACTFORM_SUBJECT

Text field for the sender to enter the subject of the e-mail

Parameters:

label - display the label
divider - HTML used to separate the label from the field
field - display the field
Code: example
{CONTACTFORM_SUBJECT=label&field&divider=</td><td>}

CONTACTFORM_MESSAGE

Textarea field for the sender to enter their message

Parameters:

label - display the label
divider - HTML used to separate the label from the field
field - display the field
Code: example
{CONTACTFORM_MESSAGE=label&field&divider=</td><td>}

CONTACTFORM_SEND_TO_ME

Checkbox that allows the sender to be copied on the e-mail.

Parameters:

label - display the label
divider - HTML used to seperate the label from the field
field - display the field
Code: example
{CONTACTFORM_SEND_TO_ME=label&field&divider=</td><td>}

CONTACTFORM_CUSTOM_FIELDS

Displays all the defined custom fields, in the order they are defined. Note: this does not refer to the pre v1.6 custom fields numbered 1 to 4.

Parameters:

pre - HTML used to prefix the label
label - display the label
labelcss - include the labels CSS class
divider - HTML used to separate the label from the field
field - display the field
fieldcss - include the fields CSS class
post - HTML used to postfix the field
Code: example
{CONTACTFORM_CUSTOM_FIELDS=label&field&fieldcss=tbox&pre=<tr><td>&divider=</td><td>&post=</td></tr>}

CONTACTFORM_CUSTOM_FIELD

Displays a custom field from the list of defined custom fields. Note: this does not refer to the pre v1.6 custom fields numbered 1 to 4 in the Contact Form admin pages.

Parameters:

number - the number of the custom field to be displayed, starting at 0 for the first field (N.B. this may change to start from 1 for the 1st custom field in future)
label - display the label
divider - HTML used to separate the label from the field
field - display the field
Code: example
{CONTACTFORM_CUSTOM_FIELD=number=1&label&field&divider=</td><td>}

CONTACTFORM_OLD_CUSTOM_FIELD

Display an pre v1.6 custom field. These are the custom fields that are labelled 1 to 4 in the Contact Form admin pages.

Parameters:

number - the number of the custom field to be displayed, starting at 1 for the first field
label - display the label
divider - HTML used to separate the label from the field
field - display the field
Code: example
{CONTACTFORM_OLD_CUSTOM_FIELD=number=1&label&field&divider=</td><td>}


CONTACTFORM_MESSAGE_MANDATORY

Displays a message indicating the symbol used to mark mandatory fields. No message is displayed if there are no mandatory fields.

CONTACTFORM_BUTTONS

Displays the Send and Reset buttons.

CONTACTFORM_BUTTON_SUBMIT

Displays the Send button.

CONTACTFORM_BUTTON_RESET

Displays the Reset button.

CONTACTFORM_DISPLAY_MESSAGE

Displays a message if there is something wrong with the submitted field, usually this is mandatory fields not completed.