Basic usage
Last updated on
11 March 2021
This documentation needs work. See "Help improve this page" in the sidebar.
This page could use more information, but here are the abbreviated basics of how to set up Fivestar in a Drupal 8/9/... site:
- Configure the Voting API and make sure you have a vote type set up properly. That's on
/admin/config/search/votingapiand/admin/structure/vote-types. - Add a field of type "Fivestar rating" to the content type, comment type, or other entity that you want to vote on using Fivestar. For content types, that would be on
/admin/structure/types, and then click Manage fields for the content type, click Add new field, and select type Fivestar rating. - On Manage Display for your content type or other entity, make sure the field you added is displayed.
- Verify that the permissions are as you expect.
If you have a scenario, where comment is attached to a node, and a user can post a comment along with rating, and average rating will show on node page. In this case below steps can be followed.
Start data:
- The node with type "Food" which contain a fivestar field "Food rating" (machine name: field_food_rating).
- The comment with type "Food review" which contain fivestar field "Food review rating".
Purpose:
When the vote has been added to comment it also should be applied to the node.
Configuration:
- Node("Food rating" field settings):
- Leave all settings by default.
- Comment("Food review" field settings):
- Select when user can rate the field: Rated while editing
- Target bridge field: entity_id
- Target fivestar field: field_food_rating
Help improve this page
Page status: Needs work
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion