This page is still a beta!

1.3. Configuration

Using TSconfig to add poll to every page

You can also add the poll to every page of your website by using TypoScript. For this purpose most of the options in the frontend plugin are also available via TypoScript. A list of all options available is shown below:

Option

Description

plugin.tx_jkpoll_pi1.pid

The uid of the page containing the poll-records (equivalent to starting-point).

plugin.tx_jkpoll_pi1.template

The path to the template which should be used (for example “/fileadmin/test.htm”).

plugin.tx_jkpoll_pi1.type

Select between vertical (0 - horizontal, 1 - vertical).

plugin.tx_jkpoll_pi1.list

Show the list of polls.

plugin.tx_jkpoll_pi1.list_first

Show the newest poll in list.

plugin.tx_jkpoll_pi1.list_limit

Only show amount of x polls.

plugin.tx_jkpoll_pi1.check_ip

Use IP-check (0 - diabled, 1 - enabled).

plugin.tx_jkpoll_pi1.check_ip_time 

Time (in hours) after which a vote is possible again (if used IP-check).

plugin.tx_jkpoll_pi1.cookie

Specify the type of the cookie (same values as in flex form).

plugin.tx_jkpoll_pi1.cookie_domainpath

If you use the poll on every page and the path changes, it would be possible to vote on every page again. To prevent this the cookie can be set for the whole domain (0 - disabled, 1 – enabled).

plugin.tx_jkpoll_pi1.check_user

Check for fe_users  (0 - disabled, 1 – enabled).

plugin.tx_jkpoll_pi1.captcha

Include captcha (0 - disabled, 1 – enabled).

plugin.tx_jkpoll_pi1.color

Default color for the poll bars.

plugin.tx_jkpoll_pi1.PIDforward

Page ID of page to which should be forwarded after successful vote.

The poll could be included with something like this:

poll < plugin.tx_jkpoll_pi1
poll.pid = 5
poll.type = 1
poll.cookie = off
page.10.subparts.POLL < poll

Creating your own template

Besides the configuration of the plugin it is also possible to use your own template-file. If you don't specify your own template, the following is used:

<!-- ###POLL_HEADER### -->  
<div>
<h1>###TITLE###</h1>
</div>
<div style="float:left; padding-right:10px;"> 
###QUESTION_IMAGE###
</div>
<div> 
###QUESTIONTEXT###
</div>
<!-- ###POLL_HEADER### -->   
<!-- ###POLL_VOTE### -->
<div>
<p>
<br />
<!-- ###ANSWER_VOTE### -->
###ANSWERTEXT_FORM### ###ANSWERTEXT_VALUE###<br />
<!-- ###ANSWER_VOTE### -->
<br />
###CAPTCHA_IMAGE###<br />
###CAPTCHA_INPUT###<br /><br />
###LINKLIST###<br /><br />
###SUBMIT###
</p>
</div>
<!-- ###POLL_VOTE### -->
<!-- ###POLL_ANSWER_VERTICAL### -->
<div>
<p>
<br />
Votes:&nbsp;###VOTES###<br /></p>
</div>
<!-- ###ANSWER_RESULT### -->
<div style="float:left; padding-right:10px;">###IMG_PERCENTAGE_RESULT###<p><br />###PERCENTAGE_RESULT###<br />###ANSWERTEXT_RESULT###<br />###AMOUNT_VOTES### Stimme(n)</p></div>
<!-- ###ANSWER_RESULT### -->
<div style="clear:both; padding-bottom:20px;"></div>
<!-- ###POLL_ANSWER_VERTICAL### -->
<!-- ###POLL_ANSWER_HORIZONTAL### -->
<div>
<p>
<br />
Votes:&nbsp;###VOTES###<br /></p>
<!-- ###ANSWER_RESULT### -->
<p>###IMG_PERCENTAGE_RESULT###<br />###PERCENTAGE_RESULT###&nbsp;&nbsp;###ANSWERTEXT_RESULT###&nbsp;&nbsp;###AMOUNT_VOTES### Stimme(n)</p>
<!-- ###ANSWER_RESULT### -->
</div>
<!-- ###POLL_ANSWER_HORIZONTAL### -->
<!-- ###POLL_LIST### -->  
<!-- ###POLL_LINK### -->
<p>###LINK###</p>
<!-- ###POLL_LINK### -->
<!-- ###POLL_LIST### --> 

The template consists of different parts described in the table below.

Part

Description

included Subparts/Markers

<!-- ###POLL_HEADER### -->

used to specify the layout of the question, markers represent the different form-fields of the question in the poll record (see Users Manual)

###TITLE###

the title of the poll

###QUESTION_IMAGE###

the image  

###QUESTIONTEXT###

the text with your question

<!-- ###POLL_VOTE### -->

specifies the layout of the possible answers people can vote for

<!-- ###ANSWER_VOTE### -->

repeated part for the different answers

###CAPTCHA_IMAGE###

image-part of the captcha-check (should only be part of the template if captcha is used)

###CAPTCHA_INPUT###

input-field of the captcha-check (should only be part of the template if captcha is used)

###LINKLIST###

link to a list of old polls

###SUBMIT###

submit button

<!-- ###POLL_ANSWER_VERTICAL### -->

specifies the layout of the vertical layout

<!-- ###ANSWER_RESULT### -->

repeated part for the different answers represented by a poll bar

###IMG_PERCENTAGE_RESULT###

the percentage of votes

###ANSWERTEXT_RESULT###

the text of the answer

###PERCENTAGE_RESULT###

the percentage of people voted for the answer

<!-- ###POLL_ANSWER_HORIZONTAL### -->

specifies the layout of the horizontal layout

<!-- ###ANSWER_RESULT### -->

repeated part for the different answers represented by a poll bar

###VOTES###

the total amounts of registered votes

###IMG_PERCENTAGE_RESULT###

the percentage of votes

###ANSWERTEXT_RESULT###

the text of the answer

###PERCENTAGE_RESULT###

the percentage of people voted for the answer

<!-- ###POLL_LIST### -->

specifies the layout of the list of all polls

<!-- ###POLL_LINK### -->

repeated part for the different links to poll

###LINK###

the link to a poll

If you adopt the template to your needs you can only insert the the layout of the poll you'd like to use (vertical or horizontal). Of course you also do not need to use all of the markers (for example ###QUESTION_IMAGE###). But be aware that the subparts are needed.

Add additional colors for the poll bars

To add additional colors you can create a gif-file with a color you like which should have the dimension 1x1 pixels. Put the image to the folder images in the location you installed the extension (for local installation this should be typo3conf/ext/jk_poll/images). To specify your new color to an answer of your poll use the part before the “.gif” (for an image named “purple.gif” this would be purple) like described in the Users manual.