Subscription template
Template programming is based on the data fields that you defined by using the database designer. These data fields contain information on the layout (notation) and the content of the single fields. The names of the data fields in your database (like NAME, JOB, TITLE, etc.) are called field names. Those field names will be integrated into the templates by using BACKCLICK-specific tags, and will always be written in capital letters. The information the subscriber enters while subscribing or checking out will be saved in your database automatically. How to create these data fields is described in Chapter “System administration” (main menu) -> “Database designer” (sub menu).
Within the programming of a template, you may access all predefined data fields in your system. All the error and success messages that may be opened by BACKCLICK while a new user subscribes are deposited in this template as HTML-code, and will only be shown if there is an error or a successful subscription.
PLEASE NOTE: All of these messages must be predefined in the template.
In this chapter, we will describe how to use the predefined input boxes in your template.
For ease of understanding, we will use examples of creating a template for subscription. To make it easier for you to program a template, we will also provide parts of the source code of the sample templates, and the explanation of the TAGs.
The figure shown below can be found in your WebInterface template management (ID 1):
Abb. 8.4.1 - Webinterface Templates (Beispiel ID 1)
Preparing the template
If there is an existing HTML page designed according to your requirements, you may now start to create the template by filling in the BACKCLICK-specific TAGs for the input boxes where the subscribers may fill in their data. If you write <!--REFRESH:10--> between the <HEAD>-</HEAD>-TAG, the subscriber will always return to the page you defined in your template link after having subscribed successfully. The number “10” defines the number of seconds it will take until the subscriber is returned to the starting page. This is an optional TAG.
Example:
<!--REFRESH:10-->
Within the HTML-template, you will now fill in a form field where all the necessary variables will be saved. All the required information for your system — such as introduction sentences, error or success messages, and the information for the input boxes — should be inserted between the <FORM>-</FORM>-TAGs. To create this form field, you will need to write the following code into your source code at the proper place:
Introduction of Form-Field:
<FORM method="post" action="web.subscribe?tid=1" name="new_reader"></FORM>
Excerpt from the HTML-Code of the sample template:
<FORM method="post" action="web.subscribe?tid=1" name="new_reader"> <TABLE> <TD width="16" bgcolor="#D9E1E8"><IMG border="0" src="../images/web/pixel_m.gif" width="1" height="1"></TD> </TABLE> </FORM>
After having defined the <FORM>-TAG, you now need to define the introduction sentences and the error or success
messages.
Add introduction sentences
These sentences will only be shown at the first call of the subscription mask and to welcome new subscribers. They will not
be shown again when there are error or success messages. To mark the sentences, you need to write the following:
<!--ENTRY--> <TR> <TD><FONT face="verdana" size="1">Welcome to our newsletter subscription website.</FONT></TD> </TR> <!--/ENTRY-->
You will select the location or position of these entries, and how often they will be shown. Any HTML-code may be used in
between these TAGs.
Error messages
BACKCLICK is able to show several error messages in case of wrong information provided by the subscriber, any input box left empty, or any system error. Whether the field in question is optional or required is defined when you create the data field.To define the error messages you need to write the following TAGs for your HTML-site.
Example: A subscriber tries to subscribe on to a newsletter he/she he or she already gets. Please include the following <ERROR>-TAG in your template:
<!--ERROR:ALREADY-ON-1--> <TR> <TD><FONT face="verdana" size="1">You have already subscribed to this newsletter!</font></TD> </TR> <!--/ERROR:ALREADY-ON-1-->
The number (ID) of the mailing list is shown in your menu: “Campaign Management” -> “Campaign Overview.”
You should remember to create this type of error message for every mailing list in your system. The text and layout may be defined for each individual error message.
Error messages that come up when there is a wrong value
The system may check whether or not every input box has been filled with information. You will configure this function in your system administration by using the database designer. The input box for the e-mail address will then be checked as to its plausibility; for example, syntactical correctness and RFC compatibility. If the e-mail address is an existing one, it will not be checked here. To show an error message when an incorrect e-mail address is entered in the input box, include the following TAG in your HTML code:
<!--ERROR:INCORRECT-EMAIL--> <TR> <TD><FONT face="verdana" size="1">Your e-mail address is incorrect. Please enter a new one!<BR> Die Email-Adresse '<?GIS name="EMAIL" content="form"?>' ist fehlerhaft</FONT></TD> </TR> <!--/ERROR:INCORRECT-EMAIL-->
Here you see what happens if an incorrect e-mail address has been entered. In this case the code: <?GIS name="EMAIL" content= "form"?> will also write the e-mail address into the error message. If an input box that was defined as a required field has no entry, you can show it to the subscriber by using his <ERROR> - TAG:
<!--ERROR:NO-EMAIL--> <TR> <TD><FONT face="verdana" size="1">Enter an e-mail address.</FONT></TD> </TR> <!--/ERROR:NO-EMAIL-->
A general error in configuration will be shown with this TAG:
<!--ERROR:CONFIGURATION--> <TR> <TD><FONT face="verdana" size="1">Error in configuration!</FONT></TD> </TR> <!--/ERROR:CONFIGURATION-->
If you see this error message, there is a mistake in your template and you need to check the HTML code and the defined data fields. You may also check the configuration of the newsletter that has been used.
Example: Data Field NEWSLETTER
<!--ERROR:NO-NEWSLETTER--> <TR> <TD><FONT face="verdana" size="1">You need to choose at least one newsletter! </FONT></TD> </TR> <!--/ERROR:NO-NEWSLETTER-->
Please enter your last name!
<!--ERROR:LASTNAME--> <TR> <TD><FONT face="verdana" size="1">Please enter your last name!</FONT></TD> </TR> <!--/ERROR:LASTNAME-->
Example: Data Field FIRSTNAME:
<!--ERROR:FIRSTNAME--> <TR> <TD><FONT face="verdana" size="1">Please enter your first name!</FONT></TD> </TR> <!--/ERROR:FIRSTNAME-->
The system checks whether the subscriber entered numbers into the input boxes for the postal code or age. These special characteristics are to be defined when creating the data field in your database designer.
Success messages
To confirm a subscription by a new subscriber, you need to enter the <SUCCESS>-</SUCCESS>-TAG. We recommend that you define these success TAGs for every mailing list that exists in your system. This success message will only be shown after the subscriber has filled every required input box with information.
<!--SUCCESS--> <TR> <TD> <FONT face="verdana" size="2"><STRONG>Congratulations!</STRONG></FONT><BR> <FONT face="verdana" size="1">E-mail address:<BR> <UL> '<?GIS name="EMAIL" content="form"?>' </UL> <BR>You have been registered for the following newsletter::<BR></FONT> </TD> </TR> <!--/SUCCESS-->
This is a typical success message. You may also define messages for every mailing list in your system. To do this, please add the ID of the mailing list separated by “-”.
Example: Mailing List 1:
Special success message:
<!--SUCCESS:NEW-NEWSLETTER-1--> <TR> <TD><FONT face="verdana" size="1">-Stock-Newsletter</FONT></TD> </TR> <!--/SUCCESS:NEW-NEWSLETTER-1-->
Inserting input boxes
The following section describes how to add the special TAGs for BACKCLICK where the subscriber needs to fill in the information. Once the definition for the layout, the content, and the field check are complete, you will only need to add the <?GIS FIELDNAME?>-TAGs into your template code. For detailed information, please read Chapter “Database Designer”.
Starting to insert the input boxes:
<!--NEW-USER-->
After you have finished inserting the input boxes, close this entry with the concluding TAG:
End of inserting input boxes:
<!--/NEW-USER-->
You may write any HTML code between these TAGs. The TAGs for laying out the input boxes in your template are described below. (They may be defined in any order.)
Example for the input box “e-mail”:
<?GIS EMAIL?>
Input box for selection of the mailing list
If you offer more than one newsletter, you need to include the following TAGs:
Example Newsletter:
<?GIS NEWSLETTER 1?>
You should specify this TAG for every mailing list in your system that your subscriber may select. Behind the word newsletter, you need to define the ID of the mailing list which that will be found in the overview of the mailing lists (Mailing List Management). The form fields for subscribing to mailing lists are predefined as check boxes, so that subscribers can sign up for more than one mailing list. It is also possible to predefine the mailing list that the user should be subscribed on without offering the option of checking out. In this case, all of the other check boxes will be invisible.
Example:
<?GIS NEWSLETTER hidden=1?>
This TAG will then be changed in the source code of the template into a ”hidden field.” If you want the subscriber to see all of the mailing lists he or she may subscribe to, but they can only sign up for one of them, you need to define a “radio” button here.The TAG will then look like this:
Example:
<?GIS NEWSLETTER 1 radio?> <?GIS NEWSLETTER 2 radio?> <?GIS NEWSLETTER 3 radio?>
Please consider adding the “radio” button to all of the NEWSLETTER fields. If you want to define a default newsletter, add the following:
Example:
<?GIS NEWSLETTER 1 radio checked?>
Extract of the HTML code of the sample template:
Example Newsletter:
<TR> <TD><?GIS NEWSLETTER 1 checked?><FONT face="verdana" size="1"><STRONG>Stock-Newsletter</STRONG></FONT></TD> </TR> <TR> <TD><?GIS NEWSLETTER 2 checked?><FONT face="verdana" size="1"><STRONG>New Market</STRONG></FONT></TD> </TR> <TR> <TD><?GIS NEWSLETTER 3?><FONT face="verdana" size="1"><STRONG>Investmentfonds</STRONG></FONT></TD> </TR> <TR> <TD><?GIS NEWSLETTER 4?><FONT face="verdana" size="1"><STRONG>IPO-Newsletter</STRONG></FONT></TD> </TR>
Input boxes for password
Add the following information to your template to create an input box for passwords:
Password: <?GIS PASSWORD?> Repeat Password: <?GIS PASSWORD?>
If you add two of these input boxes for passwords, BACKCLICK will automatically check to see if they match. This will help
prevent spelling mistakes.
Input boxes for data field: in general and individually
BACKCLICK will transform the TAGs into input boxes that will inherit the attributes predefined with the database designer. This is the case for the field type and the parameters. To create a detailed profile of your subscribers, you may offer them several possibilities to enter as much information about themselves as possible: All you need to do is add the GIS TAGs into your template. Additionally, you may use HTML code around these TAGs.
Example for the field TITLE (radio button):
<TR> <TD> <FONT face="verdana" size="1">TITLE<BR> Mister<?GIS ANREDE "Mister"?> Misses<?GIS ANREDE "Misses"?> </FONT> </TD> </TR>
If you defined a radio button or a check box, you need to name the value that should be saved in your database (<?GIS FELDNAME "value"?>). If you would like to predefine a check box or a radio button that should be marked, you need to add "checked" at the end of the TAG.
Normally you will define the data fields by using the database designer. The values you define there will be transferred to the form with the GIS TAGs. But you may change the layout you defined in your database designer by using the TAGs. Therefore, the attribute “param” is needed. Assume that you defined an input box FIRSTNAME in your database designer with a length of 50 characters. To shorten the length (for example, to two characters), you would add the following information:
Example:
<?GIS FIRSTNAME params="size=2"?>
This data field does not need to be a mandatory field. If you would like to define it as a mandatory field, you only have to add the attribute “mandatory” at the end of the TAG.
Example:
<?GIS FIRSTNAME params="size=2" mandatory?>
You may also define style sheet assignments for these input boxes.
Example:
<?GIS FIRSTNAME params="size=2 class=formatierungsname" mandatory?>
After having defined all the input boxes, you need to end the <NEW-USER>-TAG.
End of inserting input boxes:
<!-/NEW-USER-->
Using the <!--RETURN2-->-TAG will let you return the subscriber to your website by defining a link.
Example:
<A href="<!--RETURN2-->">Please click here to return to the starting page</A>
Once you have defined all the necessary input boxes for all of your newsletters, and completed the <!--NEW-USER-->-TAG, you are done creating your template.
Copyright (c) 2003-2011 ATD GmbH.
|
What do you think about this topic? Send feedback!
|