I am displaying a form for a post inside the content template for its parent post. How do I set the default value of the relationship field to be the current (parent) post?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
With your parent relationship field's value attribute what if you pass the value $current and check if that works for you.
For example:
[cred_field field='@employee-post.parent' class='form-control' output='bootstrap' value="$current" select_text='--- not set ---' required='false']
As you can see how the value attribute is populated with $current:
My issue is resolved now. Thank you!
OK, so that does populate the field, but when the form is submitted, the relationship isn't created between the two posts.
I can give access to the site if you will turn on the private fields, please.
My issue is resolved now. Thank you!
Replaced $current with [wpv-post-id] and it is working now.