Jimako-e107-plugins / e107-old-plugins

Just backup
4 stars 4 forks source link

Contact Form #4

Open Jimmi08 opened 4 years ago

Jimmi08 commented 4 years ago

1 Details 2 User Pages 3 Admin Pages 3.1 E-Mails 3.2 Pages 3.3 Preferences 3.4 Fields 3.5 Read Me 4 Templating

Current version | 1.7

-- | -- Available from | e107 plugins Author | bugrain Requirements | e107 0.7.x   | The e107 Helper Project v1.0 Bug reports | Please post bug reports and request new features at bugrain's bugtracker

User Pages

There is one user page per query string (see below).

Each page displays a form that the user can complete that allows them to send an e-mail to a specific person.

Optionally, it can display other contact details (as defined in e107's Admin settings).

Admin Pages

E-Mails Use this page to add, edit and delete e-mail addresses and related information.

These details will be presented to the user in a drop down to allow them to select who to send an e-mail to. The actual e-mail address will not be displayed or available in the HTML source.

Pages Contact Form allows multiple pages to be defined, in effect multiple contact forms. This admin page allows you to add, edit and delete those pages.

Preferences

Fields Deprecated

The following custom fields are deprecated and no longer displayed by default, please use the new Custom fields field (see the Pages admin page) instead.

Custom Fields

As many custom fields that are required can be added using the Custom fields option. Click Add field and select a field type - text, textarea, list, checkbox or radio button (and maybe more with later versions of the e107 Helepr Project plugin). You can then define attributes for your new field and click the Add button to add the field to the bottom of the field list. Use the Edit and Delete icons next to existing fields to edit and delete the associated field. The Show fields link will display all the defined fields and is there for debugging purposes (though clicking it will not cause any damage).

There are also four custom fields, just type a label for the field to have it displayed on the main user page as a text input field. These four fields are for backward compatibility with versions of Contact Form prior to v1.6,

Read Me "Does exactly what it says on the tin!"

Templating Contact Form v1.6 (and above) provides the option for the installer to customize page layouts using templates. The templating system used follows the standard e107 templating approach which relies on shortcodes. You should have some basic knowledge of templates and shortcodes (see other articles on this wiki) to understand how to write a template for Contact Form.

The advantage of using custom templates is that these templates will not be overwritten when plugin upgrades take place.

If you have a template you would like including with the next Contact Form release, please contact the plugin author.

The template to be used is selected from the current theme folder, if present, otherwise from this plugins folder. Note if you allow users to select their own theme then you will need to provide a template for each theme that you want to customize - theme's without a template will use the plugins template.

To create a new template, copy the default Contact Form template file (contactform_template.php) from the plugin folder to your theme folder(s). You can then edit the template in the theme folder(s) to suit.

Jimmi08 commented 4 years ago

Contact Form - Shortcodes

1 Overview 2 Shortcode Parameters 3 Shortcodes 3.1 CONTACTFORM_SEND_TO 3.2 CONTACTFORM_YOUR_NAME 3.3 CONTACTFORM_YOUR_EMAIL 3.4 CONTACTFORM_SUBJECT 3.5 CONTACTFORM_MESSAGE 3.6 CONTACTFORM_SEND_TO_ME 3.7 CONTACTFORM_CUSTOM_FIELDS 3.8 CONTACTFORM_CUSTOM_FIELD 3.9 CONTACTFORM_OLD_CUSTOM_FIELD 3.10 CONTACTFORM_MESSAGE_MANDATORY 3.11 CONTACTFORM_BUTTONS 3.12 CONTACTFORM_BUTTON_SUBMIT 3.13 CONTACTFORM_BUTTON_RESET 3.14 CONTACTFORM_DISPLAY_MESSAGE

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 seperated by & and name/values are seperated 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:

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 seperate 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 seperate 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 seperate 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 seperate 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 seperate 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 labeled 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 seperate 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.