Tell us what you are trying to do?
I have a post type called Hero Slider - this post type has a repeating field group, Hero Sides. I also have a view, which lists all the hero sliders, and embedded in each item in the loop is a second view, which returns all the Hero Slides associated with that particular Hero Slider. I want to expose a frontend create form for the repeating field group items along with the parent post ID, which I know can be done via a query parameter, but can't use a query parameter in this specific instance (as there are multiple Hero Sliders in the view) and need to set that data programmatically. Can you please provide some guidance on passing the parent post ID from this first view loop into the Hero Slides create post form?
Is there any documentation that you are following?
n/a
Is there a similar example that we can see?
n/a
What is the link to your site?
hidden link
Hello and thank you for contacting Toolset support.
That's totally possible. Please check the solution in this previous ticket https://toolset.com/forums/topic/automatically-set-parent-post-in-form-for-repeatable-field-group/
Especially the value="$current" that should go into the parent post field.
I hope this helps. Let me know if you have any questions.
Thanks for the input, I tried this and it did not work in our case - I think its because of the nested structures we have in our forms - but I've attached some screenshots to try and help explain our specific case.
outer loop: hidden link
inner loop: hidden link
As a note, I've tried calling [wpv-post-id] as the "default parent post" value from the create post form for Slides (thinking it would pick up the current post ID in the loop), and while this does work correctly when calling the shortcode from the view template immediately before calling the create post form shortcode for Slides, calling it from the create post form doesn't seem to be working.
Additionally, here are our differences from the three solutions in the forum post you linked in case that helps pinpoint how we can solve our issue:
1st solution) this provides a link to a discrete form page to add a new item to a RFG - we would like to have the form displayed inline in the same instance of the parent inside a view loop
2nd solution) $current gives the current page, which works if we are rendering the create post form for the RFG on the same page as its parent, but we are trying to render it inside of a view
3rd solution) this seems to be suggesting a solution to showing posts in the parent post dropdown which the current user has authored, while in our system we are trying to preselect only the specific parent post based on the current position within the view loop.
Thanks again for helping us out with this issue! Please let me know if I can clarify any of the above.
Would it be possible to log into your website and check this setup closely? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Please let me know what page are you working in?