Skip Navigation

[Resolved] Can I put a relationship field onto a post form (a post creation form)?

This support ticket is created 4 years, 7 months ago. 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.

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)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Minesh 4 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1339217
add-relationship-in-post-form.jpg

Can we add a relationship field into the "post form"? I drew and arrow in the screenshot.

#1339231
arrow .png

Or, as a second solution: can we add a 'post relation field' to a 'post form', so that it appears *here in the screenshot.

*follow the arrow in the screenshot.

#1339467

Please help

#1339475

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Basically, the form should hold the fields for the post type for which form is set to create/edit the entry.

I do not know what is the reason you want to add the relationship field to your form. Is the field belongs to parent or child post type in relationship? what is the reaosn you want to add the relationship field to your form? what are your post types and what is the relationship between them.

#1340063
Screen Shot 2019-09-13 at 10.14.47 AM.png

This is a post form. It create a CPT 'News Article. In the post form, I need users to easily and in one place and time, create the News Article and also make relationships to the CPT 'Author Curator', the CPT 'Schools of Thought' and several other CPTs, which I will add later. Right now I put in category selectors just for the mockup.

I really need to put 'post relation' custom fields in their place to do the work, relations are definitely the way to go.

hidden link

#1340073
Screen Shot 2019-09-13 at 10.26.47 AM.png
Screen Shot 2019-09-13 at 10.25.33 AM.png

I need a relationship field to go into the 'post form', maybe a 'post reference' custom field can be inserted into the 'post form'?

#1340711

Minesh
Supporter

Languages: English (English )

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

Well - I see the relationship field is already available with the form as per the following screenshot.
=> https://toolset.com/wp-content/uploads/2019/09/1340073-Screen_Shot_2019_09_13_at_10.25.33_AM.png

I see author creator and schoold of thoughts fields already available or do you mean that you want to add custom field that is belongs to CPT 'Author Curator' or the CPT 'Schools of Thought'?

What is the relationship between CPT 'News Article' and CPT 'Author Curator' or the CPT 'Schools of Thought'?

#1346749

In the picture you see the 'post reference' field. Toolset treats that different from a 'relationship': Views filter and display according to 'relationships' that are already created, or 'post reference' fields. So, is there a way to put not a 'post reference' field on to a post form, but a 'relationship'? ... Note that Toolset also creates relationships, on the front end, through 'Relationship Forms.' In a word, can we combine them - can we, so to speak, put a 'relationship form' into a 'post form'?

#1346835

Minesh
Supporter

Languages: English (English )

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

We can not combine the relationship forms.

But for example - you have created one-to-many relationship between State (one) and Cities (Many).

So, lets say if you created the form for your child post type Cities and create a post form for this post type the parent field (State) will be available to connect the city to state.

In addition to that, if you want to connect parent/child posts dynamically, we also offer post relationship API - where you can use the function: toolset_connect_posts() to establish the relationship between two posts.:
=> https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/

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