I am working on a webapp for canvasing potential voters.
I have a custom post type of "voters" that has a repeatable field group called "Voter Canvas" I have also created a post form called, "Canvas Form"
I want to have the form embedded in the single page template for the "Voter" so that we can record the results of our visit with that voter.
The reason I am using the repeatable field group is that each voter may get multiple visits over time.
However, I cannot get this to work. I have been able to get the form to show on the single page but entering information does not save to the post.
Is what I am trying to do possible?
Hello,
Yes, it should be possible within Toolset, please check these:
1) You are following our document to setup the Toolset form:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/
2) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/
3) Enable PHP debug mode, copy and paste the debug logs here, we need to know if there is any PHP error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/
PHP Debugging
To enable PHP debugging in WordPress, edit your wp-config.php file and add the following:
PHP Debugging in WP
ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
4) Deactivate other plugins and switch to wordpress default theme 2017, and test again
5) If the problem still persists, please provide a database dump file (ZIP file) of your website in below "private detail box", I need to duplicate same problem and debug it in my localhost, thanks.
I may have been a bit unclear.
The link in #1 describes using a selector to choose the parent post, also how to embed a button within the parent post that takes you to another page and autoselects the parent post.
I am looking to embed the form in the parent post. Maybe I'm missing something?
Please edit your Toolset form, and try these:
1) in section "Content", find and edit the relationship field, setup the attribute "value" as current post ID "[wpv-post-id]", for example:
[cred_field field='@voter-canvas.parent' value="[wpv-post-id]" ... ]
If you can not find the relationship field in the form, please follow above document to setup it:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-with-selectors-for-the-parent-post
2) Display above Toolset form in a single "voters" post, it should be able to preset the parent "voters" post, then test again
More help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
value.
Preset value
Thank you very much! That seems to have done the trick.