Skip Navigation

[Résolu] Selecting a post automatically in the relationship form

This support ticket is created Il y a 3 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

Auteur
Publications
#1937713

Hi Waqar,

Hop;e you are well.

Ok bit of background on the problem. I have a app with various cpts. One of my cpts is contestants that will be performing at an art festival.

the next step is a item cpt where alle the items that can be entered is listed. this is where it gets but complex. The contestant must then be connected to the item. Here I did a relationship connection being a many to many. In the relationship form, I have linked the two components. This is an excruciatingly slow process as we have to call up a contestant and the item required. Here is a possible solution we have considered but not sure if it is the best solution or if you could suggest a better solution. The solution we have thought of is to auto-populate the contestant field name with the last record just used and we will then just have to find only the next item the contestant wishes to enter for.

#1937843
#1937939

Hi Waqar, Sorry to bother you. The message where you said I must do it with a single participant page didn't seem to have reached me. Would you be so kind as to explain it again to me quickly, please? This is where I need to link participant to various items for competition.

#1939651

Waqar
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thanks for writing back.

The admin access details no longer seem to work now, but, here is what I suggested in our chat the other day.

In order to automatically select the correct "participant" to attach "items" to, you can show the form on the single "participant" page, instead of showing it on a generic independent page that you have at {yourwebsite.com}/add-contestants-to-a-item/

This is the example of a single "participant" page:
{yourwebsite.com}/participant/cred-auto-draft-7726c74b95ac858d5ccbdd91d443f0b1/

Please open the content template that is set to show a single "participant" page and add the following shortcode for the form and you'll see that the current "participant" post will be automatically selected and you'll just have to select the "item" post:


[cred-relationship-form form='connect-participant-to-item' parent_item='$current']

regards,
Waqar

#1940509

My issue is resolved now. Thank you! This was a big issue for me, Your assistance was magic!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.