Hi
On hidden link I made a view where messages on posts are displayed.
A message can be filled in in a form, for instance here hidden link
I want to show the title of the parent post in this view, but It does not work yet.
I see now all the titles who have messages in one row, in stead of the title of the parent post.
In the screenshot, you see the output of the message (form) of these two articles:
hidden link
hidden link
So, if I fill in a form in a third article, I would have here 3 links. How can I filter the output of this title.
Images: view in view -> artikelen
parent view -> messages
what to do with it?
Hello,
I assume we are talking about one-to-many post type relationship.
If it is, in the single child post, you can display parent post information with "item" attribute, for example:
[wpv-post-link item="@my-relationship.parent"]
More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
@{relationship-slug}.parent to obtain data from the related parent.
Hi,
I tried this also [wpv-post-link item="@artikel-message.parent"] but I see nothing.
I made a child view because of this message wich occur when I choose the code.
Please provide a test site with the same problem, fill below private message box with login details, also point out the problem page URLs, I need to check it in a live website
I assume we are talking about the one-to-many relationship "artikel-message":
hidden link
You need to edit those "message" posts, connect it with "artikel" post, for example, edit this one:
hidden link
in section "artikel Message", connect it with "artikel" post: Test
Test it in frontend:
hidden link
I can see it works fine:
REACTIE OP: TEST
Can you confirm it?
Hi,
I see this is the purpose.
Why is the connection not made automaticily?
I think this is a bug.
I have noticed this on other websites too.
Toolset plugins won't connect posts automatically, if you want to connect posts with the child post form, please our document:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/
section "Creating Forms with a Parent Post Preselected"
Hey Luo,
I tried this solution, but it is not working yet. It is more complicated than the example in the document.
I have the same problem with adding a new "Artikel".
I made a video for you, to show you my issues.
hidden link
Thanks for the video.
I have done below modifications in your website:
1) Edit the post form "Nieuw bericht":
hidden link
section "Form Editor", line 49, add below codes:
[cred_field field='@artikel-message.parent' class='form-control' output='bootstrap' select_text='--- not set ---' value='[wpv-post-id item="$current_page"]']
It will output the parent post selector in frontend, and use the current "artikel" post ID as the default value
2) Test it in front:
hidden link
You should be able to see the parent post selector, after user submit the post form, it will connect the message box with parent post automatically.
3) And you can use CSS codes to hide it from user, for example:
div[data-item_name="select-@artikel-message.parent"]{
display:none;
}
Yes! Thank you very much.
I will try this with my other form. When that also will succeed, I will close the ticket.
Hi Luo,
It also works fine on hidden link but 1 question:
How can I set the value by default? Like at the messages form?
This is what I have:
[cred_field field='@antiquair-artikel.parent' class='form-control' output='bootstrap' select_text='--- not set ---' author='$current']
I assume the original question of this thread is resolved, for other new questions, please check the new thread here:
https://toolset.com/forums/topic/how-can-i-set-the-value-by-default/
My issue is resolved now. Thank you!