Skip Navigation

[Resolved] Creating review system with toolset

This support ticket is created 6 years, 9 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Author
Posts
#621615

Tell us what you are trying to do?
I am trying to create a review system with toolset cred forms and types only. I tried this https://toolset.com/forums/topic/can-i-use-cred-to-make-a-custom-comment-form/ but failed.
I created CPT reviews. Then created cred form. Then I changed my theme's single.php to show review form on frontend.
now -
1. In post on frontend, post shows - review form.
2. I am unable to show reviews of each post on that page after a review has been submitted.
3. I used this to show reviews - I added in single.php - <?php echo do_shortcode('[types field='case-title']'); ?> and other shortcodes. After this, post returned blank page.
4. Each review below post shows in 3 columns as shown here on your website hidden link . But I want each box in a row
5. I used this to get comment numbers and show comments as reviews - <?php $commentscount = get_comments_number(); echo $commentscount; ?> - Now I have new CPT. How to show review number of each post with types? Also on other pages like category, search etc.

Is there any documentation that you are following?
https://toolset.com/forums/topic/can-i-use-cred-to-make-a-custom-comment-form/
Is there a similar example that we can see?
https://toolset.com/forums/topic/can-i-use-cred-to-make-a-custom-comment-form/
What is the link to your site?
hidden link

#621694

Then I changed my theme's single.php to show review form on frontend.

This should not be needed when you use Toolset.
The toolset is exactly made to avoid Custom PHP Code.

You can display any form anywhere you want, using the ShortCode and either Content Templates, or directly in the Post Body of any post.
If you have a widget that is rendering ShortCodes, then "Create new" forms will even work in Widgets if inserted as ShortCodes.

The last recommended method, and that's why not documented, is to render a CRED Form with a do_shortcode() call, which you must have done in single.php, correct?
Doing so will cause conflicts:
https://toolset.com/errata/unexpected-input-when-shortcode-with-id-attribute-is-rendered-using-php/

Since our ShortCodes are quite complex, some attributes will start to cause issues in parsing, as above erratum explains.

I cannot suggest this approach.

Only for Custom Fields, but also here, the idea is to always first try to use the base features of Toolset.
I know you mentioned to plan differently, but it's limited as Toolset is designed so to not need PHP.

The ticket here holds several different issues.

Let me reply to each shortly.

2. I am unable to show reviews of each post on that page after a review has been submitted.

I am not sure how you submit, display and update your home blog page.
We can take this issue as the main issue of this ticket if you like, but I need to know the exact steps I need to take, to get to the issue and see it.
Then, eventually, I can fix it.

3. I used this to show reviews - I added in single.php - <?php echo do_shortcode('[types field='case-title']'); ?> and other shortcodes. After this, post returned a blank page.

When developing Custom Code, which is out of the scope of this Support Forum (https://toolset.com/toolset-support-policy/), I always suggest to enable WP Debug:
https://codex.wordpress.org/WP_DEBUG

Then, familiarize yourself with the WordPress Codex, PHP Codex and Toolset API to understand the error that eventually is thrown by the above WP Debug.
https://codex.wordpress.org/
hidden link
https://toolset.com/documentation/#programmer-information

Whenever a page is throwing a WPOD (White page of death) it's due to a PHP error, which is detectable and fixable with above information.

4. Each review below post shows in 3 columns as shown here on your website hidden link . But I want each box in a row

I really do not understand this.
hidden link shows a ScreenShot of a Backend Edit Screen of a parent post.
It shows the section where you add new Child Posts.
This section is limitedly editable in Toolset > Post Types > your_parent_type > Post Relationships > Children Post Type > your_child_type > Edit Fields.

If that is what you refer to, this is the only method to edit those "child post tables".

5. I used this to get comment numbers and show comments as reviews - <?php $commentscount = get_comments_number(); echo $commentscount; ?> - Now I have new CPT. How to show review number of each post with types? Also on other pages like category, search etc.

If comments are enabled for that Post Type, and comments exist, then you can get it with the same WordPress API function as you use already.
https://codex.wordpress.org/Template_Tags/get_comments_number

But in Views there is as well a ShortCode for this:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-comments-number
This is the suggested way to use it.

To conclude, we cannot assist the full custom coding since you chose to not use the inbuilt GUI to display the data.
We can point you in the right direction, inform about the usage of our API and give the appropriate examples.

However, the approach you take will bring more need for custom code down the road and will need the assistance of Contractors, if you require help with it.

I can of course always assist Toolset API and GUI (and all related) issues.

For your case, I suggest creating a Post type that is a child to the Post type you want to comment on.
Then, with a CRED Form, you just create new Child posts when using that form - but you make it look from the front end as if you would be commenting on the post:
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/

But, this is not a full Comment system, for which Toolset is not developed.
CRED is intended to create posts, users, and more, but not comments.

If you still have any doubt about the issue #2 on the ticket (I am unable to show reviews of each post on that page after a review has been submitted.), please let me know all related details.

All other issues, if applicable to Toolset Support, would then need to receive a new ticket each.

#622229

Thanks a lot