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

1.3. Configuration

Upgrading to version 0.6+

When you upgrade from a version older than 0.6 you have to convert your old poll records in order to to use them as before. You can do that update via the Extension Manager. Use the Extension Manager and select jk_poll. In the dropdown in the upper right select the item “UPDATE!”. The database will get updated and now your old poll records can be used again. If no update is necessary the item “UPDATE!” is not part of the dropdown.

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, 2 - Google Chart).

plugin.tx_jkpoll_pi1.factor

Factor to stretch the image resultbar, Default value is 1.

plugin.tx_jkpoll_pi1.show_zero_percent

If set, options with 0 percent are shown as 1px line in the result (0 - disabled, 1 - enabled).

plugin.tx_jkpoll_pi1.list

Show the list of polls (0 - disabled, 1 - enabled).

plugin.tx_jkpoll_pi1.list_first

Show the newest poll in list (0 - disabled, 1 - enabled).

plugin.tx_jkpoll_pi1.list_limit

Only show amount of x polls.

plugin.tx_jkpoll_pi1.check_ip

Use IP-check (0 - disabled, 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.path_to_images

Alternative path to image files for the image resultbar with trailing slash. Default value is EXT:jk_poll/images/.

plugin.tx_jkpoll_pi1.PIDforward

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

plugin.tx_jkpoll_pi1.first_answer_selected

First answer is selected when showing the form to vote (0 - disabled, 1 – enabled).

plugin.tx_jkpoll_pi1.vote_language_specific

Votes are counted for every language (0 - disabled, 1 - enabled). Default value is 0.

plugin.tx_jkpoll_pi1.check_language_specific

Check for users who already voted is language specific (0 - disabled, 1 - enabled). When enabled, users could vote one time for every language available. Default value is 0.

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.

Multilanguage polls

To make jk_poll work with multiple languages on your site, follow the steps described below (same as in tt_news).

Open the sysfolder (or page) where your polls are located and create an “Alternative Page Language” for each of your translations.

Use the list module and activate the “Localization view”.

Now you should see something like this:

Just click on the flag icon to create a new translation for your poll:

Some fields which are not necessary in the translation (like the image) are excluded. So you don't see them in the form.

After you made the translations for all poll records the list module could look like this:

If you use multiple languages for your polls you can choose if the votes are counted for every single poll (different amount of votes in every language) or if the votes are counted for the parent poll (the poll created in the default language). To do so you have to use the config described in the section “Using TSconfig to add poll to every page”. The votes are counted for the parent poll by default.