Skip Navigation

[Resolved] create star rating form and display the reviews on front end

This support ticket is created 6 years, 7 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.

This topic contains 1 reply, has 2 voices.

Last updated by Beda 6 years, 7 months ago.

Author
Posts
#878264

I want to create a form to collect user reviews, kind of like this form:
hidden link

And then I want be able to display the reviews on the front end kind of like this with a star rating:
hidden link

I need for the administrator to be able to approve the reviews before they are displayed and some way to prevent spam submission.

Is this something I can do using Toolset and can you give me any help getting started?

#878826

The easiest would be to use a Plugin that does exactly that:
allow users to review your content - there are some good choices:
hidden link

However, this can as well be created with Toolset, there are a lot of solutions shared in the Forums:
https://toolset.com/forums/topic/star-rating-in-front-end-cred-form/
https://toolset.com/forums/topic/star-rating-for-reviews/#post-331847
https://toolset.com/forums/topic/how-to-get-rating-average-from-cred-for-review/

The logic is this:
- you create a new Post Type "Review"
- This post type is set as a child to the posts to be reviewed
- Create a Toolset Form, which creates new Review Posts
- Include whatever you need in the Form, such as text editors or a Radio Field with options, styled as star Fields.
- Include this form in a Content Template, which you assign to the Posts to be reviewed.

Now you will be able to submit a review for each post on the Front-end.

To make sure this review is bound to the correct currently reviewed post, head to the Toolset form and find the ShortCode that begins with:

[cred_field field='_wpcf_belongs_....

Edit it's "value" attribute, and pass [wpv-post-id].
Example:

[cred_field field='_wpcf_belongs_toolset-parent_id' value='[wpv-post-id]' select_text='--- not set ---' class='form-control' output='bootstrap']

This ensures that the new review will be a child to the currently reviewed post.
You can hide this field with HTML if you do not want the user to see it, or remove it all together and update the Review with Custom PHP later.

To display these reviews, you would create a View that queries Reviews, which belong to the Post where the View is inserted.
This can be set in the Query Filter of the View you would create.

In that View loop, you can display the reviews made and then insert the View as well in the Content Template you apply to the Posts to be reviewed.