Skip Navigation

[Resolved] I want to show the star ratings in a custom search template

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Jamal 3 years, 11 months ago.

Assisted by: Jamal.

Author
Posts
#1959319

Tell us what you are trying to do?

i designed a custom search and would like to show a custom numeric field in the star ratings format

i inserted the field into the template section of the custom search form (view)

[types field='ratings' format='FIELD_VALUE'][/types]

how do i get this to display the stars

thanks in advance

#1960187

Thank you for contacting us here in the Support Forum

The legacy views of Toolset do not include a Star Rating system by default. Toolset Blocks on the other hand offers a Star Rating block. https://toolset.com/block-item/star-rating/

If you want to implement it for the legacy views, you will need to include some custom CSS to draw the stars based on the fields value, or maybe a Javascript library. Check this suggestion from Luo on this reply https://toolset.com/forums/topic/best-way-to-create-a-star-rating-field-in-types-with-graphic-output-in-views/#post-18059

You can also create a content template using Blocks that only includes the star rating block, and then include it using a shortcode inside of your current view or content template. Does it make sense?
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153372

#1960457

thanks for your quick reply.

i am a little confused about "legacy views" ... is there another way to do a custom search that gives you code access like the custom search?

should i be doing this using the views block editor?

i would like to have conditions in the template display - is this possible with the Legacy custom search?

#1960461

i just spotted the conditions button on the template editor - i guess i could use font awesome to show the number of stars based on the numeric rating -

#1961201

Yes, you can do that too. If you want to reuse it across multiples places, I'll suggest that you build it inside a content template, then you can include the content template wherever you want to have the star rating.