Install and configure

Last updated on
7 July 2026

Installation

Install the module with Composer and enable it:

composer require drupal/votingapi_reaction
drush en votingapi_reaction

Or enable "Voting API Reaction" on the Extend page (/admin/modules); the "Voting API" dependency is enabled automatically. Enabling the module creates the six default reaction vote types with bundled SVG icons.

Configuration steps

1. Add a Reaction field

  • Go to the "Manage fields" page of the entity type where reactions should appear, for example Structure → Content types → Article → Manage fields.
  • Click "Add field" and choose the "Reaction" field type.
  • The number of values is fixed to one: each user has a single reaction per field.

2. Configure the field settings

On the field's edit page:

  • Reactions - check which reactions are available on this field and order them by weight. Every vote type marked as a reaction appears here.
  • Anonymous detection method - how returning anonymous visitors are recognized: by cookies (per browser), by IP address (shared by everyone behind the same IP), or both.
  • Anonymous vote rollover - how long an anonymous reaction is remembered before the visitor is treated as new. Either follow the Voting API global setting or set a custom window.

3. Configure the display

On the "Manage display" page, the Reaction formatter provides these settings:

  • Show reactions summary (the total count above the reactions).
  • Show reaction icon, label, and count.
  • Reaction sort order: as defined in field settings, or ascending/descending by the number of reactions.

4. Set permissions

Go to People → Permissions (/admin/people/permissions/module/votingapi_reaction). Each Reaction field defines four permissions:

  • View reactions for field … - see the reactions and their counts.
  • React to field … - post a new reaction.
  • Modify reactions for field … - change or remove an own existing reaction.
  • Control reactions status in field … - open, close, or hide reactions per entity while editing it.

Grant at least "View reactions" and "React" to the roles that should be able to use reactions, including the Anonymous user role if desired.

5. Optional: review Voting API settings

Voting API's global settings live under Configuration → Search and metadata → Voting API (/admin/config/search/votingapi). Relevant options include the anonymous vote rollover default and the vote result calculation schedule (immediately on vote, on cron, or manual).

Help improve this page

Page status: No known problems

You can: