there are a lot of choices on the display fields tab for a pollfield (the teaser and full) columns. would be nice to have some help text here about them . if some don't make sense to show, maybe form_alter them away.

my particular need is that i only want to show some textfields in the type when the poll is displayed in results mode. i am pretty sure i need to theme the node to accomplish this. is there some to know that i am in results mode beside looking for a certain string in rendered html for the pollfield?

Comments

karens’s picture

To see if you are in results mode in your theme, there is an allowvotes flag in the 'pollfields' part of the node, as:

[pollfield] => Array  (
   [field_my_field] => Array (
     [runtime] => 0
     [active] => 1
     [field_name] => field_poll
     [allowvotes] => 1
    )
  )
)    

If allowvotes is set, the default view will use theme_pollfield_view_voting($form), otherwise it will go to theme_pollfield_results($title, $results, $votes, $links, $node, $field_name).

For the most part, you just want the default view, which will intelligently handle whether to show the vote form or the results. The other options are there if you want to see only the questions or only the results, or whatever. They are really mostly there for Views so you can create views showing all your poll results. You can create a table with a column for the responses and one for the votes and one for the users to see who voted for what, for instance.

I suppose I just need to provide some documentation of that.

dddave’s picture

Version: » 5.x-1.x-dev
Status: Active » Closed (fixed)

cleaning up