Problem/Motivation

The issue #1295574: Remove vud_{node,comment,term} modules in favour of vud_field is a great initiative, only using vud_field submodule seems like a much better approach.
These widgets can be set when editing the field via "Manage fields":
Vote up and down widgets

But these widgets can not be set for the different view modes on the "Manage display" tab like when you set the appearance of an Image field for different view modes, because there are no field formatter settings:

Vote up and down field formatters are missing

Proposed resolution

I would suggest these widgets to be adjustable via the "Manage display" tab for the different view modes (like default, full, teaser, etc.) with the appropriate implementation of hook_field_formatter_info(), hook_field_formatter_settings_form(), hook_field_formatter_settings_summary() and hook_field_formatter_view().

Like this (like when setting an image field's appearance for different view modes):

Vote up and down widgets should be adjustable via the Manage display tab via field formatter settings

Remaining tasks

-

User interface changes

New field formatter settings on the "Manage display" tab for the given vote_up_down field(s): ability to set different voting widgets for different view modes.

API changes

-

Original report by vlkff

Currently, the vud_field implemens in hook_field_formatter_info just one default formatter that implements integration with voting widgets inside.
That means, that you can use just only one the widget for the field for the all your site. Actually, you are loosing the power of formatters.
I suggest to rework voting widgets system, so each widget will be recognized by drupal as formatter.

Comments

marvil07’s picture

Title: Integrating voting widgets with field formatters. » Integrating voting widgets with field formatters
Status: Needs review » Active

I see your point.

When I was doing the initial implementation of vud_field I actually though that, but I end up doing it all inside one formatter for two reasons:

  • It was simpler to do it with just one formatter.
  • To maintain coherence between the user choice(defined on the field settings) and what is shown.

So, yeah, the first reason was about time, and not really valid anymore. But the second one is still valid. I will appreciate your opinion on that.

PS: BTW "needs review" means a patch ;-)

marvil07’s picture

That means, that you can use just only one the widget for the field for the all your site. Actually, you are loosing the power of formatters.
I suggest to rework voting widgets system, so each widget will be recognized by drupal as formatter.

BTW as mentioned on other issue, this was probably a misunderstanding because of some bugs that prevented per field instance settings work right, but you now can reuse one field with different vud widgets(and just one formatter).

marvil07’s picture

Issue summary: View changes

Important changes to issue after code reviewing

Sk8erPeter’s picture

Thanks for the quick reaction in the other issue.
I've just created the issue summary, as you asked. ;)
I hope that helps.

Thank you very much for your efforts in advance!

marvil07’s picture

A module that will probably help: Field formatter settings.

marvil07’s picture

Issue summary: View changes

Sk8erPeter (issue summary)