Star rating
The free Star rating add-on adds a Rating field: stars visitors click, from 2 to 10. Find it under More in the field buttons.
<p>How was your visit?</p>
[[rating]]
Put it next to its question in a paragraph or a <div>, not inside a <label>: clicking the label’s text would pick the first star.
Settings
| Setting | What it does |
|---|---|
| Number of stars | From 2 to 10. 5 by default. |
| Size in pixels | Each star’s width and height, from 12 to 96. 28 by default. |
| Icon | The built-in gold star, or an SVG of yours from the Media Library. Stars not picked show faded and grey. |
| Required | Visitors must pick a star. When it’s off, clicking the picked star again clears it. |
Your own icon
- Click the field’s chip, then Choose an SVG… under Icon.
- Pick an SVG in the Media Library, or upload one there, and click Use this icon.
- To go back, click Use the built-in star.
SVG uploads stay off for the rest of your site: only files uploaded from this setting may be SVG. Each one keeps only its drawing (shapes, colors, gradients); scripts, links and embedded images are taken out. An SVG colored through a <style> block loses its colors, so export it again with the colors on the shapes.
In the rest of the form
- Rules: a group can show or hide on the rating, such as Rating is less than 3 to ask what went wrong.
- Mail:
[rating]prints ★★★★☆ 4/5,[_raw_rating]the number alone (4). - Keyboard and screen readers: the stars are radio buttons underneath. Arrow keys move between them, and each is read as “4 stars of 5”.
Style it
The colors are CSS variables on .remaily-rating: --remaily-rating-on (the picked stars, #f5b400) and --remaily-rating-off (the others). To change the markup, copy templates/fields/rating/default/field.php from the add-on to your-theme/remaily/fields/rating/default/field.php.