Skip Navigation

[Resolved] Create content with front-end form and post relationships

This support ticket is created 5 years, 5 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 25 replies, has 2 voices.

Last updated by Shane 5 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1257019

Hi Toolset support,

I'm new to post relationships and i would like to create a front-end form to create job posts. Is there a way to create a front-end field with post relationship options?

Thanks, Menno

#1257497

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Menno,

Thank you for contacting our support forum.

Is this a one to many or a many to many relationship ?

Please let me know.
Thanks,
Shane

#1257867

Hi Shane,

Thanks for your response. It's a many to many relationship. I'm trying to build a job site with Toolset where i have multiple post types: Jobs, Employments, Locations, etc. There can be multiple jobs within a location, etc.

#1258507

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Menno,

Unfortunately with Many to Many relationships you will need to create a separate relationship form in order to setup the relationships on the frontend.

https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

Thanks,
Shane

#1258513

But how does this work when a user (not admin) tries to post a job through a form? He can't select the attributes of the job then like location, employment, etc. It would be nice if a user can select one of all locations within the post relations. Or that i use custom fields for this but after submit they are added as a post relation from the custom post type.

#1258531

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Menno,

It depends on how much control you want.

Is it that a Job can be connected to many different locations or many different employment ? This is what I mean by many to many.

If the job can only have a single location and a single employment then this would still be a one to many relationship.

Please let me know.

Thanks,
Shane

#1258559

I would like to have a possibilty for users to find a job in multiple ways, like by location, by education, etc. A job can be a one to many, but with this method a job needs to be posted twice or more if it's available in multiple locations of a company. Or when multiple education levels are applied to a job. Is it possible to create a front-end form for posting jobs if all relationships are one to many?

#1258569

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Meno,

Yes it is possible to do it like this, everything will be on one form if its One to Many.

So your users will just need to create a new job for a different location. I actually recommend that you do it like this.

When you auto generate the form it will automatically add the relationship fields to the form.

Thanks,
Shane

#1258573

If i change the post relation between jobs and location to one to many i get this:

Maximum number of Jobs possible to assign to one Location: 1

Does this mean every location can have just one job? That's not gonna work, because there can be more jobs in a location.

#1258587

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Menno,

The limit settings for one to many would mean that 1 single job can only be added to one location. However in your case if you Create lets say a Job, Database Administrator and one of the location is Miami.

Now if another position opens at New York, you will create a duplicate of that same job and just set its Location to New York.

The locations can have many different jobs, its just that a Job can only have one location.

Thanks,
Shane

#1258597

Alright thanks. Now i want to create a form to submit jobs. Do i need to create a post form or relationship form? I tried to create a post form but then i can't find the relationship fields..

#1258605

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2019-06-04 at 10.49.37 AM.png

Hi Menno,

If the relationship field has been setup in types then you should have a relationship option when creating the form in the visual editor. See Screenshot

From there you can just drag this field onto your form.

Thanks,
Shane

#1258643

Sorry but i can't find that option.. On /wp-admin/admin.php?page=types-custom-fields ?

#1258769

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Menno,

No this is found in Toolset -> Post Forms and when you add a new post form.

Thanks,
Shane

#1259755

I think i'm doing something wrong.. I have only one to many relationships now and when i go to Toolset > Post forms and add a new one i can't see the relationship fields..

Edit: If i create post reference custom fields i can add these fields to the form hidden link.

But can i populate the dropdowns with options from the post types, so a user can pick one?