By IbnDrupal on
Hi,
I am displaying a poll on my website via a block. When the current user has not voted it shows the poll vote form, however I want to display both the current poll result and the poll vote form.
I'm sure this is possible but have no idea how, any pointers would be helpful.
Comments
Figured it out
I figured this out and am putting the answer here for others. Answer is for D6.
1. You will need to install the chart API module for this to work
2. In your template.php file paste the following function, change mytheme to your theme's name:
3. Copy the template file for the voting form to your theme directory, it can be found at /modules/poll/poll-vote.tpl.php
4. Insert the following lines into the poll-vote.tpl.php file wherever you want the chart printed
Hope that helps!
need some help
Hey,
thank you for the chart, but can you help me to display it in the result page?
Thanks,
3g0n
Sure
OK carrying on from before, put this in your template.php file (don't forget to change mytheme to your theme name)
copy the poll-results-block.tpl.php to your template folder and make it something like
And now your results block should contain the graph.
Thanks
Hi IbnDrupal, I got a chart. but I want to cancel my vote below the graph.
any suggestions.....
if you want to display
if you want to display multiple poll in the same page, you should change the chart id to :
'#chart_id' => 'poll_chart' . $variables[nid],Thanks arbel but I've tried
Thanks arbel but I've tried to add the code to allow multiple polls and it doesn't appear to show the each individual google chart. Strangely if I have two polls in the same page, the only chart displayed is the first one and the other charts show the same images URL as the first, so I need to make a distinction somewhere in the code to allow two or more charts to be rendered in one page. I do have a chart in a block as well. Could this be causing the problem?
Is there another way around this?
multiple polls in a single page
Hi , i am doing this by using node_load function
hi i'm interested by the
hi i'm interested by the method of saiprasad_saiprasad
it does not require any additional module but uses hook_load($node)
if you can describe the way you did it here it would be fine
thanks ;)
display poll in a page
$am__node = node_load($nodeid); echo node_view($am__node, "FALSE");
Does this work on Drupal 7.x
Hi,
I have tried the method suggested by you but I did not work. I am working in Drupal 7 and novice to the system. Will this technique work on Drupal 7 if not could you tell me the way to make it work?
Thanks a ton.
Regards
Vishal Jain
some passing variable changed
hi vishal, passing variables changed in drupal 7 and drupal 8.
check below:
4.6 – 6 node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
7 – 8 node_view($node, $view_mode = 'full', $langcode = NULL)
Thanks @IbnDrupal, for a
Thanks @IbnDrupal, for a great tip
Can anyone help me to do this
Can anyone help me to do this in Drupal 7, please?
I've followed step by step but it doesn't work.
Thanks.