Skip Navigation

[Gelöst] Can I automatically pass a post to a relationship field for frontend forms?

This support ticket is created vor 2 Jahre, 11 Monate. There's a good chance that you are reading advice that it now obsolete.

Dies ist das technische Support-Forum für Toolset – eine Suite von Plugins zur Entwicklung von WordPress-Websites ohne PHP-Pogrammierung.

Jeder kann in diesem Forum lesen, aber nur Toolset-Kunden können darin Beiträge veröffentlichen. Der Toolset-Support arbeitet 6 Tage pro Woche, 19 Stunden pro Tag.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by Minesh vor 2 Jahre, 11 Monate.

Assigned support staff: Minesh.

Author
Artikel
#1691193

upD
4.jpg
3.jpg
2.jpg
1.jpg

Tell us what you are trying to do?

I am creating a site with three custom post types: customers, projects, project contributions.
These are created with "1 : n" relationships "customers : projects" and "projects : project contributions".
After making a new customer through the frontend, I can click on a link to create a new project.
I want to have that new customer automatically selected in the relationship field of the new project.
Is this possible?

Thank you in advance!

#1691455

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Yes - we can set the default value but it depends where you added the form or you want to pass the customers ID as URL param.

If you can share the problem URL where you added the form and where you added the link to create the product I will review it and guide you in the right direction.

*** 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.

#1691769

upD

Thank you for your answer,

I cannot give access right now, I will see if we can run the problem on a test site tomorrow.
To display the links I use the option to display a message after submit.
I already saw that the post ID of the customer is still in the URL when the links are displayed,
can I use that somehow?

Thank you in advance!

#1692411

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

I am not sure yet how you are passing the URL param to your link but the correct format to pass the URL param so that the parent dropdown item automatically selected is:

<em><u>hidden link</u></em>

Where:
- the URL pram is constructed as: parent_{parent-posttype-slug}_id - so if your parent post type slug is "customer", then the param will look like: parent_customer_id=9999
- And replace 9999 with your parent post ID.

Das Forum „Toolset Professioneller Support“ ist für neue Themen und Antworten geschlossen.