I am breaking this out of the general discussion #589210: The future of Pollfield. Especially the comments #9-14 are about this problem. Currently we have a problem because of the need to create a (unhideable) question for the poll AND the Drupal requirement to give a node title. This results in a double display of the question and hinders the creation of a usable independent content type.

Comments

mario_prkos’s picture

If you don't need views question formatter that mean that you don't need views which will list all questions of polls filtered by something. You can just put the question in title and for question put ' ' (there is space between them). ' ' means that question is empty and will not be displayed.

dddave’s picture

Issue tags: +Needs documentation

lol

I did some little research and find out how can be done (title=question) with existing release and dev version. Actually, this option I built in in the beginning but I didn't have time to put proper documentation. But, now is time to do that.

This module should have its own docs page. I could start one during this week if you don't beat me to it. Always wanted to explore how to properly create such a book page.

Ok, I tried this and it worked well. I am going to explore how this impacts usability especially with views.

mario_prkos’s picture

Super, great!!! I put some new features and improve some views formatters, also I solved some issues about anonymous voting policy.
You can check out. It will available after 12:00 GMT in dev version. I am so excited to see this module full equipped.

dddave’s picture

Re #1:

If you don't need views question formatter that mean that you don't need views which will list all questions of polls filtered by something.

Is there any difference in functionality or usability if I don't use the question field but instead have my question in the title field? It seems to me that the options I have are the same, i.e. there are no special options when I use the question field. All I can do with the content of this field I can do with a node title, can't I? Instead "Content:......" I can use "Node: Title" for example at the filter settings of a view.

mario_prkos’s picture

Yes, you are right you can filter content by node: title. Probably, you can do everything as the question is put in the question field. There is no really any issue regard to the empty question. Only thing is that question formatter is than empty but you can use node title instead of it. When you use views with cck (Conten) you have option Format which is in bottom of configuration form. Pollfield has several ways which can be displayed by views:default, question, all results, all choices and runtime.
1. deafault: ordinary display as you can see it in node
2. question: displays only question of poll so you can for example make views that lists only questions of active polls
3. results: displays results and question of poll (you can make views which will display only results of poll for print or analyze purpose)
4. choice: displays choices of poll
5. runtime: displays duration of poll
You can use different formatters for different purpose that is beauty of CCK modules.

dddave’s picture

Status: Active » Fixed

This is fixed and documented.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pasena’s picture

2 mario_prkos
You've said "3. results: displays results and question of poll (you can make views which will display only results of poll for print or analyze purpose)"
It shows the choices, bars and results in per cent and votes count. How do I make the view to show for example results in per cents only? I'm a new guy in php, tried to look through the code, it's really hard. You must be genius. Thanks a lot for this modul!

mario_prkos’s picture

Everything what is display in pollfield is results of theme functions. In the function pollfield_theme() you declare all yours displays (themes). Those which is connected with views have prefix formatters.You can edit some existing one or put another one. Pollfield has formatters:
theme_pollfield_formatter_default,
theme_pollfield_formatter_results,
theme_pollfield_formatter_block_default,
theme_pollfield_formatter_choices,
theme_pollfield_formatter_question,
theme_pollfield_formatter_runtime,
As you can see all of this functions have html as output. You can override them in your theme or change it in module. Override is better solution because after module is updated you change will be preserve in your theme. For your purpose you need to change theme_pollfield_formatter_results and edit parts where you can see html code. Also you can install dev module and use dpm($variable_name) to display content of different php variables.
Results is displayed in part:

 if ($is_this_user_vote) {
      $poll_result .= "<div class='pollfield-row pollfield-chosen'><div class='text'>". $choices_array[$i] ."</div><div class='barcell'><div
      class='bar'><div class='pollfield-foreground' style='width: ". $percent ."%;'></div></div></div><div class='pollfield-percent'>".
      $percent_string ."</div></div>";
    }
    else {
      $poll_result .= "<div class='pollfield-row'><div class='text'>". $choices_array[$i] ."</div><div class='barcell'>
      <div class='bar'><div class='pollfield-foreground' style='width: ". $percent ."%;'></div></div></div><div class='pollfield-percent'>".
      $percent_string ."</div></div>";

    }

just delete what you don't want.

I hope it helps.

pasena’s picture

Thanks a lot for help! It helped. This is the best poll module.