How do I display half stars?

Created on 31 October 2020, about 4 years ago
Updated 8 July 2024, 7 months ago

Hi,

if a thing has the average rating of 4.5, it currently displays as 5 stars. How can I make it display visually as 4.5 stars instead?

I know that in older versions of Fivestar (Drupal 6), half stars were displayed by default, but after migrating my site to Drupal 8, they are no longer there. Everything gets rounded up to the nearest full star. In fact, even the source image files no longer seem to have images of half stars. Is there a way I can re-enable them?

Note: I'm asking merely about displaying half stars, not about voting in half stars (there's a separate - outdated - module for that). I've found some open issues around asking a similar question but they all seem to be about older versions of the module.

Thanks.

Feature request
Status

Needs work

Version

1.0

Component

Theming

Created by

🇨🇿Czech Republic markus_cz

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India ravi kant Jaipur

    i did not find half star option but i save average voting result link 3.5 or 4.5. The average is generating according to number of voting one same node.

    The other option may be "Number of stars" 10 instead 5.

    But i am also looking for half star feature.

  • 🇩🇪Germany drupalbubb

    The same here.

  • Assigned to mayurgajar
  • 🇮🇳India mayurgajar

    We can add configuration field formatter to add - disabled roundoff.. which by default set to FALSE
    But if we want to have half star, then set disabled roundoff to TRUE
    so we are able to get appropriate data and by using minimum css able to get half star at appropriate place.

  • Pipeline finished with Failed
    7 months ago
    Total: 156s
    #215810
  • Pipeline finished with Failed
    7 months ago
    Total: 154s
    #215815
  • Pipeline finished with Failed
    7 months ago
    Total: 154s
    #216239
  • Issue was unassigned.
  • Status changed to Needs review 7 months ago
  • 🇮🇳India guptahemant

    Reviewed the Code in PR, it looks good as a start, Moving this to needs review for manual testing.

  • Status changed to Needs work 7 months ago
  • 🇺🇸United States tr Cascadia
  • 🇮🇳India mayurgajar

    Steps to test:
    * Add fivestar rating field on content
    * Set the Disabled roundoff of the rating value to TRUE
    * user should add content rating
    * Check the rating values on content - if it has decimal value.. this should display half star rating value

  • 🇺🇸United States tr Cascadia

    "Needs tests" means automated tests, not manual testing.

Production build 0.71.5 2024