Skip Navigation

[Resolved] Creating Forms with a Parent Post Preselected

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.

Our next available supporter will start replying to tickets in about 0.54 hours from now. Thank you for your understanding.

Author
Posts
#2375699

// Tell us what you are trying to do?

The comment section in a wordpress blog post functions like what I am about to achieve.
I want to let logged in users leave post reviews using a post form. This shall function similarly to comments where each comment is attached to a certain post after it has been submitted by a page visitor.

Problem:
I created a post type called "reviews" and a post type called "services". Now I want to let users post a review for each service post that exists on my website. But how to achieve this connection through a post form? Normally I would say the post id of the service post has to be saved in a custom field of the review post form. But how to achieve that using Toolset? Or is there a better solution for this problem?

// Is there any documentation that you are following?

I have read the following documenation and it seems to be what I am looking for, but to create a child post link didn't work because I am working with oxygenbuilder templates and that is where the review form should be placed at the end.

Creating Forms with a Parent Post Preselected:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/#main-toolset-block-used-in-this-lesson

// What is the link to your site?

hidden link (but it is under construction)

#2376073

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

You can create a one-to-many relationship between the "services" and "reviews" post type to be able to link one "service" post to many "reviews" posts.
( ref: https://toolset.com/lesson-placement/lesson-placements-1729031-1727251/ )

After that, you'll create a form to "add a new review" post, that will include a field to select the parent "service" post. In that field's default value, you can use the current post ID shortcode "[wpv-post-id]", so that the current "service" post is preselected in that field.
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-id )

Once the form is ready, you can place it in the template used for the single "service" post page, and users will be able to post reviews for individual services.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2376645

My issue is resolved now. Thank you!