I have a contact post type and an actor profile post type. The contact post type holds the general info about a contact like name, address, phone, etc. The actor profile post type is in related to the contact post type as child. The actor profile contact is attached to the contact post type for contacts that are defined as actors.
On the list with all actors, I would like to add a button to
'add a new actor'
it should then display a form for creating a new contact, where the user first enters all the general information.
Then the user should be directed to the 'add actor profile' form where he can enter the actor specific information.
When submitting, the user should be directed to the newly generated acting profile post. And in the background, the newly created contact post type and actor profile post type should be connected with a relationship.
1. is this the right approach? if not, please enlighten me 🙂
2. if yes: how do I build this?
Hello. Thank you for contacting the Toolset support.
As I understand, you first want to create the parent post entry and on submit of that parent form you want to redirect the user on the page where child form is added and when the child form is submitted you want to connect the parent with child.
So, technically, create a page X where you add the parent form and then create another page Y where you add the child form. When you submit the parent form on page x, use the "cred_success_redirect" hook and redirect the user of page Y and add parent post ID as URL param where child form is added.
Hey Minesh, sorry for the very long wait, I am back and have tried your solution, What I am struggling with is how to include the ID of the parent post in the URL param so that I can read it in the child form. Can you help me out? Thanks a lot. Tobias
If you can share the problem URL where you added the form and tell me where exactly you want to redirect the user, I would be happy to check and adjust the hook for you.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Hey Minesh, sorry, I've just realised I've given you the wrong ftp folder info: you do NOT need the /tools.stories.ch/ part - you can just use the ftp credentials as I have given you, without a subfolder. Sorry about that. Cheers Tobi
Well - I see you are using the following form:
=> hidden link
Now, if you see the page, I've added the "Create New" link that will redirect the user to "Add New Actor Profile" page:
=> hidden link
As the form creates a new entry, there is a field "Contacts Actor Profiles" available to connect with your new entry. I'm still not sure what parent you want to link to your profile?
Hmm, I think we are misunderstanding each other. The parent is the contact. The child is the actor profile. The button that creates the parent form is on this page: hidden link
When you click the blue button 'add actor', it brings the user to the parent form to create a contact. then by clicking on ^next page' in the form, it brings the user to the add actor profile which creates the child post type.