Tutorial to tipafriend

Extension Key: tipafriend

Copyright 2006, acherzog@web.de, <acherzog@web.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

Tutorial to tipafriend	1

Intro	1

What does it do?	1

Tutorial	1

Insert Plugin	1

Template Entry	2

Constant Editor	5

Email notification	6

Extension Template	7

Install Extension by marker	7

FAQ	8

How to delete the field "Repeat Code"?	8

How to use the extension in a multi-lingual way?	8

Intro

Special Thanks to Kornelia Lepke for her help with this translation and to Franz Holzinger to fix the problems with the multi-lingual pages.

What does it do?

This Extension (Author: Kasper Skårhøj) draws a form which allows the website user to send a local link to another email address with a comment attached.

Tutorial

Install the extension from TER. Install the extension CAPTCHA too.

This tutorial allows you to to install tipafriend step-by-step. There are two ways to install it: as a plugin on only one page of your website or as a marker on all the pages.

Insert Plugin

Make a new page and insert the plugin of the extension into this page (general plugin).

Choose the plugin, “tip-a-friend” in German “Tipp geben”

Set the code TIPFORM. You best set the page to “hide in menu”.

Now you get this view:

Abbildung 1: Abb.1

Template Entry

Abbildung 2: Abb. 2 Edit the template “edit whole template record” and add the static template by choosing “include static”.

In the frontend you get the following view:

Abbildung 3: Abb. 3

Under “Repeat Code” you are asked to repeat the text in the picture. In Abb.3 a picture isn´t visible yet.

Installieren Sie die Extension CAPTCHA aus dem TER und schon wird der Code sichtbar. Leider ist er nicht sehr gut lesbar.

Now you have to install the CAPTCHA extension and you can see the code. But unfortunately it is`nt very easy to read.

Abbildung 4: Abb. 4

Create a content element on the page, you want to recommend and put in the tipafriend plugin.

Set the code to TIPLINK.

Abbildung 5: Abb. 5

In the frontend you get the following view:

Abbildung 6: Abb. 6

If you click this link, a form appears which you can fill in and send to a recipient.

Abbildung 7: Abb. 7

After sending the form, you get this information:

Abbildung 8: Abb. 8

“Go back” brings you back to the page, from where you did the tip, not back to the form.

To make the extension work correctly an entry in the constant editor is necessary.

Constant Editor

Open the constant editor and set the PID of the page with the code TIPFORM. If you like, you can change some colours and fonts here.

Öffnen Sie nun den den Constant Editor und tragen die PID der Seite mit dem Code TIPFORM dort ein. Wenn Sie wünschen, können Sie an dieser Stelle das Layout und die Farben etwas ändern (s. Abb. 9).

Abbildung 9: Abb. 9

Email notification

The recipient will receive an email immediately after the form is submitted.

Abbildung 10: Abb. 10

Extension Template

If you want to adjust your template, you first have to copy it in your template directory.

Write the following into your constants:

plugin.tipafriend.templateFile = fileadmin/tipafriend_template.tmpl

This allows you to include a template which you can change according to your needs. If you want to use a multilingual page, create the corresponding templates. More about mulit-lingual uasage in the FAQ.

Install Extension by marker

A slightly different procedure is necessary if you want to install tipafriend by marker in your html-template.

This marker allows you to set the tip on every page of your website.

Only the link to very page which the visitor has chosen as a recommendation will be sent.

Procedure step-by-step:

Create your formpage with the code TIPFORM, as described above.

Insert the PID of this page in the constant editor.

Define a Marker ###TIP### in your HTML – Template.

Edit your setup and inssert the following code in the part where you have defined your markers:

marks.TIP

marks.TIP = USER

marks.TIP.userFunc = tx_tipafriend->main_tipafriend

marks.TIP.templateFile = fileadmin/tipafriend_template.tmpl

marks.TIP.code = TIPLINK

marks.TIP.typolink.parameter = 1149

Thus the marker and the template will be included, the code woll be inserted as well as the PID of the form page.

The “go back”-button leads you back to the page you recommended, mot to the page with the form.

FAQ

How to delete the field "Repeat Code"?

First delete the part of the template.

One was now is to uninstall the CAPTCHA extension which controlls the repeat code. But if you need this extension for further programmes you have to look for the class.tx_tipafriend.php. Here you have to search for the field "captchaResponse" an delete it from the funktion. Please note that your chages will be overwritten by updating the extension.

How to use the extension in a multi-lingual way?

Create a template for each language an put it into your template directory. Don´t forgot to set the plugin of the form in the translation for the page. Add the following entry tho your setup:

# Standard Template – is used, if no lanuage ist chosen

plugin.tipafriend.templateFile = fileadmin/tipafriend_template_std.tmpl

# Standardlanguage UID 0 -> German

[globalVar = GP:L = 0]

plugin.tipafriend.templateFile = fileadmin/tipafriend_template_de.tmpl

[global]

# English, sys_language.uid = 1

[globalVar = GP:L = 1]

plugin.tipafriend.templateFile = fileadmin/tipafriend_template_en.tmpl

[global]

You also have to change the settings described in chapter “Install Extension by marker “ in the in the setup. Instead of, write this into the setup.

TIP < plugin.tipafriend

TIP.defaultCode = TIPLINK

TIP.typolink.parameter = 2436

Tutorial to tipafriend -

Tutorial to tipafriend

Andrea Herzog-Kienast

2004-04-01T17:27:57

Andrea Herzog-Kienast