[Typo3] Poll (plugin.tt_poll) in TypoScript featured by TemplaVoila
srdjan.prodanovic at gmail.com
Wed Mar 2 15:20:19 CET 2005
Somewhere along the production of my first Typo3 featured website a
decision was made, to include a simple poll. Nor I or the customer are
overly demanding of the functionality, so I figured plugin.tt_poll
would be just the right thing, despite it's age, deprecation and lack
of security functionality.
I read up on the extension documentation and the relevant user
anottations, which were in some cases very useful (the mini HOWTO).
After successfully deploying the plugin as a content Record, I started
tweaking the output to break it out of tables, add VOTEFORM, RESULT
toggling functionality and have everything nicely styled according to
my website design.
First obstacle was that the poll wouldnt count any votes. Setting
voteform.locationData to false cured this.
The major problem struck me, when I tried to map an area of my
template in TemplaVoila, and feed it with a TypoScript object,
containing my Poll. At first I was really lost in the documentation,
cause of the pollTable, pollTableUid and pollTablePid propertys.
Unfortunately the documentation wasn't really self explanatory:
Usage from another object
If you need a poll for another record and a link to, it should be done
through TypoScript where you simply insert your poll object as a
content element in a COA or whatever renders your element.
10 = LOAD_REGISTER
10.tt_whatever_uid.field = uid
20 = < plugin.tt_poll
20.pollTable = tt_whatever
20.pollTableUid.data = register : tt_whatever_uid
The record field tt_poll.linkrecord has to be set with a 'record link':
[End of CITE]
Since I've never created custom tables and have little insight on the
actual structure of data in them, it's still more or less a mistery to
me. I've read all the relevant information, and what I pulled from it
is, that this way you can set your poll to use some other content
entrys as poll options, and store the votes there. If someone has a
better understanding of this, please post a little more in-depth
explanation :-) .. especially if this kind of approach could be used
on tt_records as well.
In the end, I decided I would probably prefer using the current record
for storing information anyway and started looking in the maillists to
find an answer on how to trap the poll output and functionality in a
TypoScript object, used by TemplaVoila to populate a mapped Content
Element. I found a big stack of threads, some of them discussing my
desired functionality. I ended up with the easy code for populating an
object with data from a hidden record:
lib.poll = RECORDS
# this is the pid of the "Insert records" record that aggregates the
source = 99
tables = tt_content
[END of CODE]
This worked great for display, but I ended up with a slight problem in
the functionality. Once again, my poll wasnt counting votes,
disregarding the voteform.locationData bool being true or false. Last
night, being frustrated by the time wasted on this poll, I fiddled
with any possible configuration combination I could think of and even
got the poll to work for a short time. Knowing that I don't know how I
made it work anyway, I predicted what had later come true. The poll
stopped working after clearing cache or something similar.
Is anyone aware of plugin.tt_poll having problems with TemplaVoila
TypoScript object mapping?
Are there any other ways of supplying TemplaVoila with the poll object
data, without the actual "Insert records" as a Content Elements
record? For instance: Having the poll record in a Storage folder, and
accessing it's values and functionality through TypoScript.
Could TemplaVoila be confused because the page I mapped the lib.poll
object at, has no Content Elements element, and therefore disregards
Why wont my poll store data? :-\
Your help will be greatly appretiated, since I had to concentrate on
other parts of the production. For now the ignorant poll remains there
as a decoration. A workaround would probably be creating another
Content Elements section, since my configuration works that way, but
please help me out if you can, for the sake of my future development
of TypoScript knowledge. I'd hate utilising needless workarounds in
every project I make :-)
Srdjan 'some1else' Prodanovic
More information about the TYPO3-english