Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact Form #4

Open
Jimmi08 opened this issue Dec 28, 2019 · 1 comment
Open

Contact Form #4

Jimmi08 opened this issue Dec 28, 2019 · 1 comment

Comments

@Jimmi08
Copy link
Member

Jimmi08 commented Dec 28, 2019

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.

  • Display order - the order the e-mail will be displayed in the drop down list (in relation to other e-mails).
  • Pages - the Contact Form page(s) that the e-mail will be displayed on. Make sure at least one item is selected otherwise the e-mail will not appear anywhere.
  • Title - the title (name) that will appear in the drop down list for this e-mail.
  • E-mail - the e-mail address itself,. for multiple e-mails add one per line.
  • Name - additional information that appears in the drop down list.
  • Description - a description to allow the admin to provide additional notes and is not displayed on the main page.

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.

  • Name - the name of this page - displayed to the user.
  • Description - description for this page - displayed to the user.
  • Query string - the query string for this page. To access this page this string should be added to the end of the URL, e.g. contactform.php?complaints. Leave this blank for the default page (no query string required), only one page can have a blank query string.
  • Userclass - the userclass that can access this page.
  • Sender's name - set the sender's name field to be hidden, shown or mandatory.
  • Sender's e-mail address - set the sender's e-mail address field to be hidden, shown or mandatory.
  • Subject - set the subject field to be hidden, shown or mandatory.
  • Message - set the message field to be shown or mandatory.
  • CC - set the CC field to be hidden or shown.
  • 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 Helper 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).

Preferences

  • Subject prefix: allows you to define a prefix for the subject of the e-mail. Useful to help identify e-mail sent from Contact Form/website.
  • Default from e-mail - Default from e-mail address when no e-mail address is supplied
  • Default from name - Default from name address when no name is supplied
  • Image code verification - Check to turn image code verifcation on. Image code verification helps reduce spam from the Contact Form plugin.
  • Track IP Addresses - Check to turn IP address tracking. When switched on, a record is written to the Admin log each time an e-mail is sent from the plugin.
  • Mandatory symbol: The symbol that will be used to identify fields that are mandatory to the user.
  • Mandatory colour: The colour that will be used for field labels for fields that are mandatory to the user.
  • 'Send to' as column: Select whether to show the send to drop down box as a two column table (title, name) or not.
  • Visibility: Select which type of user can use the form. This is a global setting, individual pages can have a more restrictive setting as required.
  • Confirmation message: The text that will be displayed after a message has been successfully sent.
  • Show contact details: Allows additional contact details (as defined in e107's Admin->Settings->Preferences) to be displayed above or below the contact form (or not at all).
  • Debug mode: For development only, should not be used on live servers.

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
Copy link
Member Author

Jimmi08 commented Dec 28, 2019

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:

  • label - display the label
  • divider - HTML used to seperate 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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant