Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Tip-a-friend

From TYPO3Wiki
Jump to: navigation, search

<< Back to Extension manuals page

[edit]

This page belongs to the Content Rendering - Team (category ContentRenderingTeam)

HTML template

This is a draft of a table-less, XHTML 1.1-compatible (currently it is XHTML 1.0 strict) and accessible template for the tip-a-friend extension.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="de-DE" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Tip-a-Friend template</title>
	<style type="text/css">
        	label {width:10em; float:left; }
	</style>
</head>

<body>
<h1>Tip-a-Friend template</h1>


<h2>TEMPLATE_TIPFORM</h2>
<p><em>Template for the form where the user sends the tip-a-friend mail.</em></p>
<!-- ###TEMPLATE_TIPFORM### begin
	This is the template for the form where the user enters the email addresse of the recipient.
	-->
	<div class="tipafriend">
    	<form action="###FORM_URL###" method="post">
        	<h2>Tip a friend:</h2>
            <p>You're now sending this link to an email recipient: <a h-r-e-f="###URL###">###URL_DISPLAY###</a></p>
	        <!-- ###ERROR_MSG### begin (this subpart is removed if the form has no errors!) -->
            	<p class="error"><strong>Error: You didn't fill in all required fields or the email addresses was not valid!</strong></p>
	        <!-- ###ERROR_MSG### end -->
            <fieldset>
            	<legend>Tip-A-Friend</legend>
                <div class="tipafriend_form">
                	<label for="tipform_name">Your Name*: </label>
                    	<input type="text" size="30" name="TIPFORM[name]" value="###YOUR_NAME###" id="tipform_name" /><br />
                	<label for="tipform_email">Your Email*: </label>
                    	<input type="text" size="30" name="TIPFORM[email]" value="###YOUR_EMAIL###" id="tipform_email" /><br />
                	<label for="tipform_recipient">Recipient email*: </label>
                    	<input type="text" size="30" name="TIPFORM[recipient]" value="###RECIPIENT###" id="tipform_recipient" /><br />
                	<label for="tipform_message">Message: </label>
                    	<textarea cols="30" rows="4" name="TIPFORM[message]" id="tipform_message">###MESSAGE###</textarea>
                </div>
            </fieldset>
            <fieldset>
            	<legend>Options</legend>
                <div class="tipafriend_form">
                	<label for="tipform_html_message">HTML message: </label>
                    	<input type="checkbox" name="TIPFORM[html_message]" value="1" id="tipform_html_message" ###HTML_MESSAGE### /><br />
                    <p>To prevent misuse of this form we kindly ask you to read the letters in the image and repeat them in the form field:</p>
                    <div class="captcha">###CAPTCHA_HTML###</div>
                	<label for="captchaResponse">Repeat code: </label>
                    	<input type="text" size="30" name="TIPFORM[captchaResponse]" value="" id="captchaResponse" />
                </div>
            </fieldset>
            <p><em>You must fill in fields with * correctly!</em></p>
            <div class="tipafriend_form">
            	<input type="submit" name="submit" value="Send" />
                <input type="hidden" name="tipUrl" value="###URL_SPECIALCHARS###" />
                <input type="hidden" name="sendTip" value="1" />
            </div>
        </form>
    </div>
<!-- ###TEMPLATE_TIPFORM### end -->
<br /><br />


<h2>TEMPLATE_TIPFORM_SENT</h2>
<p><em>Template for displaying the 'is sent'-message</em></p>
<!-- ###TEMPLATE_TIPFORM_SENT### begin
	This is the template for the 'is-sent' display.
	-->
	<div class="tipafriend_sent">
    	<h2>Message is sent to:</h2>
    	<p class="recipient_list">###RECIPIENT###</p>
        <p class="backlink"><!--###LINK###-->Go back<!--###LINK###--></p>
    </div>
<!-- ###TEMPLATE_TIPFORM_SENT### end -->
<br /><br />


<h2>TEMPLATE_TIPLINK</h2>
<p><em>Template for the link to the tip-page</em></p>
<!-- ###TEMPLATE_TIPLINK### begin
	This is the template for the form where the user enters the email addresse of the recipient.
	-->
    <div class="tipafriend_tiplink">
    	<p><!--###LINK###-->Click here to tip a friend about this page!<!--###LINK###--></p>
    </div>
<!-- ###TEMPLATE_TIPLINK### end -->
<br /><br />


<h2>TEMPLATE_EMAIL</h2>
<p><em>Template for the plain link notification email.<br />
First line is used as subject for the mail.</em></p>
<!-- ###TEMPLATE_EMAIL### begin
	Template for the plain link notification email.
	First line is used as subject for the mail.
	-->
Tip: Check this news

###YOUR_NAME### (###YOUR_EMAIL###) wants you to take a look at this link:
###URL###

This is the message:
###MESSAGE###

Best regards
<!-- ###TEMPLATE_EMAIL### end -->
<br /><br />


</body>
</html>

TypoScript example

An example TypoScript code on how to configure Tip-A-Friend for TemplaVoila templates:

temp.tipafriend = USER
temp.tipafriend {
 userFunc = tx_tipafriend->main_tipafriend
 code = TIPLINK
 templateFile = {$plugin.tipafriend.file.templateFile}
 typolink.parameter = 999             # uid of the TipForm page
}

lib.tipafriend = TEXT
lib.tipafriend < temp.tipafriend

You set $plugin.tipafriend.file.templateFile in the Constants section of the template like this:

plugin.tipafriend.file.templateFile = fileadmin/templates/tipafriend.tmpl