10808 Posts in 2494 Topics by 1782 members
|Go to End|
11 May 2011 at 3:23am
i try to make the polls module work with SS 2.4.5. I can creat the polls and answares, but i cant show the poll. I have page type ShowPoll.ss and i can choos it. But i can't choose a specific poll. I need to make something like then you choose an image to thumbnail or page to redirect.
Is there any option to make it?
11 May 2011 at 4:28am
As I recall I used the polls and inserted it on the page as a widget - this was all I required - have you tried that?
I don't recall there being an entire page dedicated to it (I may have removed it myself though).
11 May 2011 at 7:51pm
I try it right now. But I can't see the poll as a widget.
A attach two files. One is the screen of widget and one is the polls.
How I can add the poll to some page? I have the Poll and Answers in the database. How I can show that in the frontend?
11 May 2011 at 8:39pm
well I couldn't find anything - except the code from the old site where I used it - please find it attached here
11 May 2011 at 9:28pm
Well... Thanks so much. It works for me now.
Now I need to show this widget on the different page. No only on the blog module... and I need to transform "Show Random Poll" to "Show $This Poll"
We'll see how it goes next
11 May 2011 at 9:40pm
After see the MASSIVE (ha ha) amounts of code in those widgets I think it is just adding the $MyPoll to the Page.ss and the frunction MyPoll to the appropriate controller.
if you want to force the poll, then modify "class ShowPoll" so that the __construct takes an ID and then uses that with a get_by_id instead of a get_one... at this point...
function __construct($controller, $name)
$poll = DataObject::get_one('Poll', 'IsActive = 1', true, DB::getConn()->random());
function __construct($controller, $name,$iPollID)
$poll = DataObject::get_by_id('Poll', $iPollID);
|Go to Top|