Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source MagazineAOE Media

1.5. Tutorial

Default mode

You can use the logical form immediately. In the default mode the logical form has

  1. a country field and

  2. a city field.

The form evaluates

  1. if obligated fields are filled up and

  2. if the visitor is from the European Union or not.

Create pages with content

Add three pages with the following structure to your typo3 backend:

  1. Default sample

    1. Success

    2. Failure

Illustration 9: Default example

In the page “Success” you add a text element with this content e.g.:

You are European Union!

The evaluation of the data was successful.

You can publish here everything for visitors who are from a country in the European Union like

  1. Germany or

  2. Spain

In the page “Failure” you add a text element with this content e.g.:

Not a member of EU

You can publish here everything for visitors who are not from the European Union because they are from

  1. Switzerland or

  2. USA

Add the plugin “logical form” to the page “Default sample”

Configure the extension template

Next, please add an extension template with the name “+ext logical_form”.

Illustration 10: Default sample with the plugin and the template

Configure the template:

  1. Insert in the field “setup” the following lines (the pids are the pids of your pages “Success” and “Failure):

plugin.tx_logicalform_pi1.pids.success = 637

plugin.tx_logicalform_pi1.pids.failure = 636

  1. Insert in the field “include static template” the template “static (logical_form)” like in the illustration below.

Illustration 11: Configuration of the extension template

The result in the frontend

Illustration 12: The logical form in the frontend

The result in the frontend have to be the logical form like in the illustration.

Please test your logical form (look the examples above in the chapter “screenshots” on page 2):

  1. Send the form without any value: There will be two error messages.

  2. Send it with the values “Germany” and a city of your choice: There will be the message, that you are a member of the European Union.

  3. Send it with the values “Switzerland” and a city of your choice: There will be the message, that you aren't a member of the European Union.

If you want to know, how to configure the logical form plugin

  1. give the two further examples a trial in the tutorial below or

  2. take a look in the reference on page 20 or

  3. check the setup of the tx_logicalform_pi1 with the typoscript object browser.

Disclaimer with two steps

In this exercise we use the logical form in a cascading way:

  1. We ask, if the user understand our disclaimer.

  2. If yes we will guide our visitor to the next page, where we will ask him, if he is a member of the European Union. We will add some country fields.

Illustration 13: Page tree in the backend

We need following pages and structure:

  1. Disclaiming

    1. Country

      1. Success

      2. Failure

    2. Failure

Feel free to add the following content:

  1. Disclaiming:DisclaimerThis is the place where you can explain what to disclaim. In the first step you can ask your visitor if he understands your explanation.

    1. Country:Are you a member of EU?We want to know, if a visitor is coming from a country which is a member from the european union. If yes, we will guide him to a "success"-page. We will guide all other vistors to a "unsuccess"-page.

      1. SuccessYou are European Union!The evaluation of the data was successful. You can publish here everything for visitors who are from a country in the European Union like- Germany or- Spain

      2. Failure:Not a member of EUYou can publish here everything for visitors who are not from the European Union because they are from- Switzerland or- USA

    2. FailureSorry, you are to stupidWe can't help you anymore.

Now we build our first own logical form.

Add the plugin logical form

Add the plugin logical form in the pages

  1. Disclaiming and

    1. Country

Configure the extension template of the page Disclaiming

Next, please add an extension template with the name “+ext logical_form” like in the example of “configure the extension template” on page 4.

  1. Insert in the field “setup” the following lines (the pids are the pids of your pages “Country” (case success) and “Failure” (like the illustration on page 5):

#

# WORKFLOW

# ========

#

plugin.tx_logicalform_pi1.workflow = failure_page

plugin.tx_logicalform_pi1.pids.failure = 493

plugin.tx_logicalform_pi1.pids.success = 494

#

# FIELDS, WE DON'T NEED

# =====================

#

plugin.tx_logicalform_pi1.fields.country >

plugin.tx_logicalform_pi1.fields.city >

#

# FIELDS

# ======

#

plugin.tx_logicalform_pi1.fields.confirm.radio.br = 0

plugin.tx_logicalform_pi1.fields.confirm.radio.required = 1

plugin.tx_logicalform_pi1.fields.confirm.radio.value.0 = no

plugin.tx_logicalform_pi1.fields.confirm.radio.value.1 = yes

plugin.tx_logicalform_pi1.fields.confirm.radio.failure.0 = no

#

# LANGUAGE EN (DEFAULT)

# =====================

#

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_confirm = I have understand the disclaimer

plugin.tx_logicalform_pi1._LOCAL_LANG.en.legend = Confirmation

plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_yes = Yes

plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_no = No

plugin.tx_logicalform_pi1._LOCAL_LANG.en.submit_button_label = Send

#

# LANGUAGE DE

# ===========

#

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_confirm = Ich habe den Disclaimer verstanden

plugin.tx_logicalform_pi1._LOCAL_LANG.de.legend = Bestätigung

plugin.tx_logicalform_pi1._LOCAL_LANG.de.value_yes = Ja

plugin.tx_logicalform_pi1._LOCAL_LANG.de.value_no = Nein

plugin.tx_logicalform_pi1._LOCAL_LANG.de.submit_button_label = Weiter

The whole setup is written in the file pi1/samples/setup_disclaim_1st.txt. You can read the file with the extension manager:

Illustration 14: The setup code

Or copy the code above and paste it into your setup.

  1. Insert in the field “include static template” the template “static (logical_form)” like in the illustration in the example of “configure the extension template” on page 4.

The Logical Form should look like this in the frontend now:

Illustration 15: Your first logical form

If you choose “No” the logical form will guide you to the failure page.

If you choose “Yes” the logical form will guide you to the success page.

Now we have to configure the success page. But before we explain the used setup code.

Explanation of the setup code

The “workflow” has to possibilities:

  1. failure_page

  2. form

The first (“failure_page”) means, that if the values aren't the values we want (the visitor doesn't understand the disclaimer), then the visitor will guided to a page with a message.

The second (“form”) means, that the visitor will get an error message on the same page – the page with the logical form. Example for this message: Sorry, there is a mistake in your mail address.

#

# WORKFLOW

# ========

#

plugin.tx_logicalform_pi1.workflow = failure_page

The pids are the pids of your pages for success (in this example the page “Country”) and failure  (like the illustration on page 5).

plugin.tx_logicalform_pi1.pids.failure = 493

plugin.tx_logicalform_pi1.pids.success = 494

In the default mode the logical form has two fields – country and city. We don't need it, we delete it.

#

# FIELDS, WE DON'T NEED

# =====================

#

plugin.tx_logicalform_pi1.fields.country >

plugin.tx_logicalform_pi1.fields.city >

But we need a radio button with the two values “no” and “yes”.

“fields.confirm” is the name of the field.

“fields.confirm.radio” is the Html type of the field in the form.

“fields.confirm.radio.br” has the following effect:

  1. 0: There will be no line break between the values

  2. 1: There will be a line break between the values

“fields.confirm.radio.required” has the following effect:

  1. 0: The visitor doesn't have to fill up the field.

  2. 1: The visitor has to fill up the field. There will be added an asterisk to the field name in the form automatically. There will be added the comment “Please complete fields which have an asterisk” at the bottom of the form automatically.You can edit every language expression. See Chapter “How to configure language for fields and values“ on page 15.

“fields.confirm.radio.value” is an array with the values of the radio button.

“fields.confirm.radio.failure” is an array with the values, we don't want to accept for the success case.

#

# FIELDS

# ======

#

plugin.tx_logicalform_pi1.fields.confirm.radio.br = 0

plugin.tx_logicalform_pi1.fields.confirm.radio.required = 1

plugin.tx_logicalform_pi1.fields.confirm.radio.value.0 = no

plugin.tx_logicalform_pi1.fields.confirm.radio.value.1 = yes

plugin.tx_logicalform_pi1.fields.confirm.radio.failure.0 = no

With the _LOCAL_LANG array you can configure the display of your field names and values.

If you want to determine the displayed name of the field, you have to set it in this format:

  1. language.field_name = value

“language” has the value of the language like “en” for English or “de” for german.

“field_name” has the value “field_” and than the name of the field. In the example above we defined the displayed name of the field “confirm”:  _LOCAL_LANG.en.field_confirm = I have understand the disclaimer.

If you want to determine the displayed values of a field, you have to set it in this format:

  1. language.value_name = value

“language” has the value of the language like “en” for English or “de” for german.

“value_name” has the value “value_” and than the name of the value. In the example above we defined the displayed name of the value “yes”:  _LOCAL_LANG.en.value_yes = Yes

Here you have the value for the submitbutton:

  _LOCAL_LANG.en.submit_button_label = Yes

#

# LANGUAGE EN (DEFAULT)

# =====================

#

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_confirm = I have understand the disclaimer

plugin.tx_logicalform_pi1._LOCAL_LANG.en.legend = Confirmation

plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_yes = Yes

plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_no = No

plugin.tx_logicalform_pi1._LOCAL_LANG.en.submit_button_label = Send

Below there is the same example for german language:

#

# LANGUAGE DE

# ===========

#

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_confirm = Ich habe den Disclaimer verstanden

plugin.tx_logicalform_pi1._LOCAL_LANG.de.legend = Bestätigung

plugin.tx_logicalform_pi1._LOCAL_LANG.de.value_yes = Ja

plugin.tx_logicalform_pi1._LOCAL_LANG.de.value_no = Nein

plugin.tx_logicalform_pi1._LOCAL_LANG.de.submit_button_label = Weiter

Configuring the success page

The success page “Country” is showing the same logical form like the page “Disclaiming”.

Illustration 16: Page "Country" without configuration

This isn't a surprise really, because we didn't configure the extension template of the page “Country”.

Our page “Country” should look like this:

Illustration 17: Page "Country" with configuration

We have to complete the following orders:

  1. We want to display the default logical form with the fields “country” and “city”.

  2. We have to configure the pids of the success and failure page.

  3. We have to delete the field confirm.

Configure the extension template

Next, please add an extension template with the name “+ext logical_form”.

Illustration 18: Default sample with the plugin and the template

Configure the template:

  1. Insert in the field “setup” the following lines (the pids are the pids of your pages “Success” and “Failure):

#

# WORKFLOW

# ========

#

plugin.tx_logicalform_pi1.workflow = failure_page

plugin.tx_logicalform_pi1.pids.failure = 496

plugin.tx_logicalform_pi1.pids.success = 495#

# FIELDS, WE DON'T WANT AND WE DELETE

# ===================================

#

plugin.tx_logicalform_pi1.fields.confirm >

  1. Insert in the field “include static template” the template “static (logical_form)” like in the illustration below.

Illustration 19: Configuration of the extension template

The result in the frontend should look like this:

Illustration 20: Page "Country" with configuration

Confirmation mode

This exercise demonstrate, how to create a form for ordering something:

  1. We need only a success page (for confirmation) and we don't need a failure page.

  2. We have to delete the default fields.

  3. We have to create some fields.

  4. We have to configure the mails to the provider and the visitor.

Create pages with the content and the plugin

Illustration 21: Confirmation example

Add two pages in the following structure to your typo3 backend:

  1. Confirmation

    1. Success

Please add to the page “Confirmation”

  1. this content:ConfirmationThis an example for the confirmation case.E.g. a visitor like to get a document by postal delivery. He can order the document with the form above. He will get a confirmation if he filled up every field and if there is no mistake in the mail.

  2. the plugin “Logical Form”

  3. and an extension template “+ext logical_form”

Please add to the page “Success” this content:

  1. Thank youThanks for ordering our document.If you have any question please call us. * Contact (Link to your contact page)

Configure the extension template of the page Confirmation

Next, please add an extension template with the name “+ext logical_form” like in the example of “configure the extension template” on page 4.

  1. Insert in the field “include static template” the template “static (logical_form)” like in the illustration in the example of “configure the extension template” on page 4.

  2. Insert in the field “setup” the following lines (the pid is the pid of your page “Success”:

#

# WORKFLOW

# ========

#

plugin.tx_logicalform_pi1.workflow = form

plugin.tx_logicalform_pi1.pids.failure >

plugin.tx_logicalform_pi1.pids.success = 634

#

# MAIL TO THE CLIENT, THE VISITOR OF OUR WEBSITE

# ==============================================

#

plugin.tx_logicalform_pi1.mail.to_client = 1

plugin.tx_logicalform_pi1.mail.to_client.from.mail = name@my.provider.com

plugin.tx_logicalform_pi1.mail.to_client.from.name = my provider company

plugin.tx_logicalform_pi1.mail.to_client.bcc = dirk.wildt@think-visually.com

plugin.tx_logicalform_pi1.mail.to_client.field = mail

plugin.tx_logicalform_pi1.mail.to_client.body = mail_client

plugin.tx_logicalform_pi1.mail.to_client.signature.0 = my provider company

plugin.tx_logicalform_pi1.mail.to_client.signature.1 = my provider contact

plugin.tx_logicalform_pi1.mail.to_client.signature.2 = my provider street

plugin.tx_logicalform_pi1.mail.to_client.signature.3 = my provider zip and city

plugin.tx_logicalform_pi1.mail.to_client.signature.4 = my provider phone

plugin.tx_logicalform_pi1.mail.to_client.signature.5 = my provider mail address

#

# FIELDS, WE DON'T NEED

# =====================

#

plugin.tx_logicalform_pi1.fields.country >

plugin.tx_logicalform_pi1.fields.city >

#

# NEW FIELDS

# ==========

#

plugin.tx_logicalform_pi1.fields.mail.input.failure.0 = my.name@example.com

plugin.tx_logicalform_pi1.fields.mail.input.failure.1 = dirk.wildt@think-visually.com

plugin.tx_logicalform_pi1.fields.mail.input.default = my.name@example.com

plugin.tx_logicalform_pi1.fields.mail.input.size = 30

plugin.tx_logicalform_pi1.fields.mail.input.maxlength = 60

plugin.tx_logicalform_pi1.fields.mail.input.required = 1

plugin.tx_logicalform_pi1.fields.mail.input.mail = 1

plugin.tx_logicalform_pi1.fields.sexus.radio.br = 0

plugin.tx_logicalform_pi1.fields.sexus.radio.required = 1

plugin.tx_logicalform_pi1.fields.sexus.radio.value.0 = male

plugin.tx_logicalform_pi1.fields.sexus.radio.value.1 = female

plugin.tx_logicalform_pi1.fields.name.input.size = 30

plugin.tx_logicalform_pi1.fields.name.input.maxlength = 60

plugin.tx_logicalform_pi1.fields.name.input.required = 1

plugin.tx_logicalform_pi1.fields.street.input.size = 30

plugin.tx_logicalform_pi1.fields.street.input.maxlength = 60

plugin.tx_logicalform_pi1.fields.street.input.required = 1

plugin.tx_logicalform_pi1.fields.zip_city.input.size = 30

plugin.tx_logicalform_pi1.fields.zip_city.input.maxlength = 60

plugin.tx_logicalform_pi1.fields.zip_city.input.required = 1

plugin.tx_logicalform_pi1.fields.phone.input.size = 30

plugin.tx_logicalform_pi1.fields.phone.input.maxlength = 60

plugin.tx_logicalform_pi1.fields.phone.input.required = 1

plugin.tx_logicalform_pi1.fields.note.textarea.cols = 30

plugin.tx_logicalform_pi1.fields.note.textarea.rows = 5

plugin.tx_logicalform_pi1.fields.note.textarea.required = 0

#

# LANGUAGE EN (DEFAULT)

# =====================

#

plugin.tx_logicalform_pi1._LOCAL_LANG.en.legend = I want this document

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_mail = Mail

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_name = First and last Name

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_note = Message to the provider

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_phone = Phone

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_sexus = Gender

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_street = Street

plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_zip_city = ZIP and City

plugin.tx_logicalform_pi1._LOCAL_LANG.en.mail_client_subject = Delivery of the ordered document

plugin.tx_logicalform_pi1._LOCAL_LANG.en.mail_client_text (

Dear ###VALUE_NAME###,

Thanks for ordering our document.

We will send it with postal delivery to your address:

   ###VALUE_NAME###

   ###VALUE_STREET###

   ###VALUE_ZIP_CITY###

You have send the following data:

###VALUES###

If there is any mistake please send the correct data.

Please visit this page and fill up the form:

###URL###

This is a mechanical message.

Best Regards

###SIGNATURE###

)

plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_female = Female

plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_male = Male

#

# LANGUAGE DE

# ===========

#

plugin.tx_logicalform_pi1._LOCAL_LANG.de.legend = Ich möchte das Dokument

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_mail = eMail

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_name = Vor- und Nachname

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_note = Nachricht an den Betreiber

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_phone = Telefon

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_sexus = Anrede

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_street = Straße

plugin.tx_logicalform_pi1._LOCAL_LANG.de.field_zip_city = PLZ und Ort

plugin.tx_logicalform_pi1._LOCAL_LANG.de.mail_client_subject = Versand des bestellten Dokuments

plugin.tx_logicalform_pi1._LOCAL_LANG.de.mail_client_text (

Hallo ###VALUE_NAME###,

herzlichen Dank für die Bestellung unseres Dokuments.

Wir senden Ihnen das Dokument per Post an Ihre Adresse:

   ###VALUE_NAME###

   ###VALUE_STREET###

   ###VALUE_ZIP_CITY###

Sie haben uns folgende Daten gesendet:

###VALUES###

Sollte in den Daten ein Fehler stecken, senden Sie uns Ihre richtigen Daten bitte ein zweites Mal.

Besuchen Sie dafür bitte folgende Seite:

###URL###

Dies ist eine automatische generierte Mitteilung.

Mit freundlichen Grüßen

###SIGNATURE###

)

plugin.tx_logicalform_pi1._LOCAL_LANG.de.value_female = Frau

plugin.tx_logicalform_pi1._LOCAL_LANG.de.value_male = Herr

The whole setup is written in the file pi1/samples/setup_disclaim_2nd.txt. You can read the file with the extension manager:

Illustration 22: The setup code

Or copy the code above and paste it into your setup.

    Explanation of the setup code

    We don't repeat the explanation of the example above “Explanation of the setup code” on page 7. If you didn't read it, please read and understand it now.

    The workflow value is “form”, because there is only the failure case of missing data or wrong mail addresses. In this case every error should displayed with a message in the form and not in a failure page:

    1. We set workflow to: form

    2. We delete the value pids.failure

    #

    # WORKFLOW

    # ========

    #

    plugin.tx_logicalform_pi1.workflow = form

    plugin.tx_logicalform_pi1.pids.failure >

    plugin.tx_logicalform_pi1.pids.success = 634

    The array mail.to_client is explained in the chapter “mail” on page 16.

    How to configure fields

    Illustration 23: The form without language configuration

    In our form we need the following fields:

    1. mail (input)

    2. sexus (radio)

    3. name (input)

    4. street (input)

    5. zip_city (input)

    6. note (input)

    It is easier to understand the controlling of the Logical Form, if we don't use the language configuration.

    Therefor we commented out the lines with the language configuration as shown below:

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.legend = I want this document

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_mail = Mail

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_name = First and last Name

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_note = Message to the provider

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_phone = Phone

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_sexus = Gender

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_street = Street

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_zip_city = ZIP and City

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_female = Female

    #plugin.tx_logicalform_pi1._LOCAL_LANG.en.value_male = Male

    The following images show, how to control fields.

    Field name, field type and field values

    Illustration 24:plugin.tx_logicalform_pi1.fields.mail...plugin.tx_logicalform_pi1.fields.sexus...

    Illustration 25:plugin.tx_logicalform_pi1.fields.mail.input...plugin.tx_logicalform_pi1.fields.sexus.radio...

    Illustration 26:plugin.tx_logicalform_pi1.fields.sexus.radio.value.0 = maleplugin.tx_logicalform_pi1.fields.sexus.radio.value.1 = female

    Required fields

    Illustration 27:plugin.tx_logicalform_pi1.fields.mail.input.required = 1plugin.tx_logicalform_pi1.fields.sexus.radio.required = 1

    Default values and evaluating of a mail address

    Illustration 28:plugin.tx_logicalform_pi1.fields.mail.input.default = my.name...

    Illustration 29:plugin.tx_logicalform_pi1.fields.mail.input.mail = 1

    How to configure language for fields and values

    In our example we want that

    1. the field “mail” will be displayed as “Mail”,

    2. “sexus” as “Gender” and

    3. the values “male” as “Male” and “female” as “Female”

    #

    # LANGUAGE EN (DEFAULT)

    # =====================

    #

    ...

    plugin.tx_logicalform_pi1._LOCAL_LANG.en.field_mail = Mail

    ...

    Illustration 30: Our form without any translation

    Illustration 31:..._LOCAL_LANG.en.field_mail = Mail..._LOCAL_LANG.en.field_sexus = Gender

    Illustration 32:..._LOCAL_LANG.en.value_female = Female'..._LOCAL_LANG.en.value_male = Male

    Mail

    Configuring the mail to the client – the visitor of our website

    You have to configure the array “ mail.to_client...”.

    You have to set the flag “mail.to_client” to 1, otherwise the server won't send any mail to a client.

    #

    # MAIL TO THE CLIENT, THE VISITOR OF OUR WEBSITE

    # ==============================================

    #

    plugin.tx_logicalform_pi1.mail.to_client = 1

    plugin.tx_logicalform_pi1.mail.to_client.from.mail = name@my.provider.com

    plugin.tx_logicalform_pi1.mail.to_client.from.name = my provider company

    plugin.tx_logicalform_pi1.mail.to_client.bcc = dirk.wildt@think-visually.com

    plugin.tx_logicalform_pi1.mail.to_client.field = mail

    plugin.tx_logicalform_pi1.mail.to_client.body = mail_client

    plugin.tx_logicalform_pi1.mail.to_client.signature.0 = my provider company

    plugin.tx_logicalform_pi1.mail.to_client.signature.1 = my provider contact

    plugin.tx_logicalform_pi1.mail.to_client.signature.2 = my provider street

    plugin.tx_logicalform_pi1.mail.to_client.signature.3 = my provider zip and city

    plugin.tx_logicalform_pi1.mail.to_client.signature.4 = my provider phone

    plugin.tx_logicalform_pi1.mail.to_client.signature.5 = my provider mail address

    We hope, that the illustration below shows the relation between the mail and the controlling with the setup understandably.

    With the value

    plugin.tx_logicalform_pi1.mail.to_client.field = mail

    you determine, in which field of the form we found the mail address of the client.

    We explain in step II, how to configure the mail subject and the mail message.

    Illustration 33:The field name of the mail address is “mail”.In the setup it's the line: plugin.tx_logicalform_pi1.fields.mail...

    In the illustration on the right you found the field name “mail” in line 3 of the setup.

    In our example the visitor (client) had filled up the field “mail” with the address:

    dirk.wildt@puppenspiel-portal.de

    Illustration 34: The sent mail and the controlling with the setup

    Configuring the subject and the message of the mail to the client

    You have to define

    1. the subject and

    2. the message text

    in the language array “_LOCAL_LANG”. You are free, to define the string, which is marked yellow. But is has to be the same string like in the setup variable “.mail.to_client.body.

    plugin.tx_logicalform_pi1.mail.to_client.body = mail_client

    ...

    plugin.tx_logicalform_pi1._LOCAL_LANG.en.mail_client_subject = ...

    plugin.tx_logicalform_pi1._LOCAL_LANG.en.mail_client_text = ...

    In the message – the mail body – you may work with markers.

    If you want use values, which the client have written in the form, there is this main principle:

    1. ###VALUE_fieldname###

    For example:

    In the form is a field called “street”, than the marker in the mail is ###VALUE_STREET###.

    If you want a list of all form values, than you use the marker ###VALUES###.

    There a two markers additionaly:

    1. ###URL###: The Url of the form

    2. ###SIGNATURE###: The setup array “.mail.to_client.signature...”

    Our Example

    plugin.tx_logicalform_pi1._LOCAL_LANG.en.mail_client_subject = Delivery of the ordered document

    plugin.tx_logicalform_pi1._LOCAL_LANG.en.mail_client_text (

    Dear ###VALUE_NAME###,

    Thanks for ordering our document.

    We will send it with postal delivery to your address:

       ###VALUE_NAME###

       ###VALUE_STREET###

       ###VALUE_ZIP_CITY###

    You have send the following data:

    ###VALUES###

    If there is any mistake please send the correct data.

    Please visit this page and fill up the form:

    ###URL###

    This is a mechanical message.

    Best Regards

    ###SIGNATURE###

    )

    And the result:

    Illustration 35: Fields and values in the form

    Illustration 36: Mail with values of the form and of the setup

    Configuring a report mail

    With Logical Form you can configure a report mail.

    This mail send all datas of the form to a mail address of your choice.

    Example for a configuration:

    #

    # MAIL REPORT I.E. TO THE ADMIN OR/AND THE PROVIDER OF THE WEBSITE

    # ================================================================

    #

    plugin.tx_logicalform_pi1.mail.report = 1

    plugin.tx_logicalform_pi1.mail.report.from.mail = webmaster@my-domain.com

    plugin.tx_logicalform_pi1.mail.report.from.name = Typo3 Logical Form Report

    plugin.tx_logicalform_pi1.mail.report.to.0 = henry@statistic.com

    plugin.tx_logicalform_pi1.mail.report.to.1 = mary@statistic.com

    plugin.tx_logicalform_pi1.mail.report.signature.0 = My company

    plugin.tx_logicalform_pi1.mail.report.signature.1 = My name

    plugin.tx_logicalform_pi1.mail.report.signature.2 = My street

    plugin.tx_logicalform_pi1.mail.report.signature.3 = My zipcode and my city

    plugin.tx_logicalform_pi1.mail.report.signature.4 = My phone

    plugin.tx_logicalform_pi1.mail.report.signature.5 = my.name@my-domain.com

    If you want to edit the mail content, please edit

    1. pi1/locallang.xml (see chapter “Language” on page 26)

    Avoid Spam

    If you want to avoid spam use captcha.

    1. Please install the extension Captcha Library (extension key: captcha) or freeCap CAPTCHA (extension key: sr_freecap)

    2. Configure the use of captcha in the logical form

    plugin.tx_logicalform_pi1.captcha.extkey.captcha = 1

    or

    plugin.tx_logicalform_pi1.captcha.extkey.sr_freecap = 1

    Troubleshooting

    If the logical_form extension doesn't display anything (not even an error message) check the following:

    1. Did you set a “static template (from Extensions)” in your TS-template?

    2. Clear all TYPO3 caches, including the temp files in typo3conf, clear your Browser cache.

    Debug Mode

    The Logical Form has a debug mode. In this mode the extension will print messages in your Html code. The debug mode makes sense, if you have any problem with mailing.

    Turn the debug mode on:

    plugin.tx_logicalform_pi1.mail.debug = 1

    You will get the following output e.g.:

    Illustration 37: Example for Html output in the debug mode