bs-production / sure-dry-template

0 stars 0 forks source link

Inline reviews widget, empty reviews and only stars #27

Open IamStephan opened 3 years ago

IamStephan commented 3 years ago

The best way to handle this would be on the backend but it might also be solved in the frontend using JS. In the widget settings, select the max number of widgets to display (may cause strain on the server). Then hide them by default using CSS. Once the JS is loaded in, select all the widgets with text up to the desired amount.

So if there are 30 total reviews, 5 with text and the desired amount is 8, append the 5 reviews first then add the 3 remaining non-text reviews. This ensures the first reviews always have text inside.

To avoid jumps in the page and empty states, there can be skeleton review items with a loading animation to give the appearance of loading (technically it is loading the JS). The reviews are still in the HTML that gets sent. so it doesn't impact SEO