I have 2 CPT's related. "Movies" and "Crew Member"
I created a relationship (1toMany) form between both to add crew member Childs to the parent movies.
On the single page of a movie I want have a link to the relationship form to "preselect" the parent (the movie).
So I add a "Fields and Views" and select my relationship link. But the results is only "tiny_mce_marker" instead of the link to the form. What did I do wrong ?
I've made a mistake, so this reminder helps.
However, I'd like on my "movie" page have a link "add a crew member" which will open the form page with the preselected "movie" from where I come. Can you help ? Because for the moment, the "movie" selected is the current post which is the form page...
Minesh is not available today. We are sorry for the inconvenience and appreciate your patience, He will be available soon to check with your question.
To answer your question would you please follow the steps below?
1 Put the form on its own page
Create a page called “Add crew member” (or use an existing one) and add the relationship‑form shortcode, telling it which movie should be pre‑selected:
[cred_form
form="add-crew-member" ; slug or ID of your relationship form
parent_id="[wpv-search-term param='movie_id']"
]
* parent_id is the attribute that sets the parent post for one‑to‑many relationships.
* [wpv-search-term] pulls whatever you pass in the URL (movie_id=123).
2 Place a link on every single‑movie page
Inside the template for Movies add an ordinary link or button:
<a href="/add-crew-member/?movie_id=[wpv-post-id]">
Add a crew member
</a>
[wpv-post-id] outputs the ID of the movie you’re viewing, so the link becomes something like:
Thanks a lot for your help. What is the syntax if I want to replace the "form="add-crew-member" " by the ID of the form ? Because with the slug targeting it does not find the form. Its a many to many relationship. Maybe it's where the issue is...