There is a link for child cred form which placed on parent post.
If the link pressed by author of parent post then parent name in the form is autofilled correctly.
If the link pressed by non-author of parent post then parent name in the form is autofilled incorrectly.
field default value for relationship field in child form - [wpv-post-id]
Please help to understand why this happen and how to fix it.
Thank you
Anton
Hello,
In the single parent post, you can display the post form for creating new child post, and setup relationship field default value as:
[wpv-post-id item="$current_page"]
More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
$current_page is used to retrieve data from the current page being rendered.
I need to have the child post form on a separate page. For this I used instruction
https://toolset.com/course-lesson/front-end-forms-for-editing-content/
create new child post link
Link based on shortcode was created by instruction:
1. Field & Text
2. Add Form
3. Create Child Post Link
as a result I have a link on parent post page.
Link based on shortcode for Create child post link
[cred_child_link_form form='14613' parent_id='-1' text='Превратить Волну в Волшебный Щит' target='_self']
You are referring wrong document, please follow our document to setup the child form and form link:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/
When user click the child form link, it will pass parent post ID as URL parameter, so you don't need to setup the relationship field default value
it passes parent post ID only in case author of post is logged in user.
Otherwise the filed is empty, parent post ID is not passed.
There might be something wrong setting in your website:
The child form shortcode [cred_child_link_form] should display in single parent post
So it will be able to pass parent post ID as URL parameter, if you did not follow our document to setup the child form link, it won't work as expected.
I follow the instruction exactly. Attaching screenshots step-by-step.
Please provide a test site with the same problem, I need a live website to test and debug
Thanks for the details,
I assume we are talking about the post form "Volshebnye_volny_form_Волшебники"
hidden link
And I can not find the child form link shortcode in your content template.
So I have tried these in your website:
1) Edit above post form:
hidden link
find and edit field "Волшебные Волны Волшебников", enable option "Get options by any author"
2) Create a new page "Create new child Volshebnye_volny post":
hidden link
Display above post form
3) Edit content template "Волшебник"
hidden link
at the bottom, display the child form link:
[cred_child_link_form form='14810' text='Create new child Volshebnye_volny post' target='_self']
Test it in frontend, for example:
hidden link
click link "Create new child Volshebnye_volny post"
It works fine:
hidden link
Please test again check if it is fixed.
My issue is resolved now. Thank you a ton for a solution!