Skip Navigation

[Resolved] Making a database about Job location

This support ticket is created 4 years, 9 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 – 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)

Author
Posts
#1290245

Hi,
I am making a website about jobs search. Hence I am adding multiple custom fields for a job description. Here I need to add a specific field about job location. I want this field to be added in such way/manner, so that I can use it in the search criteria or creating related jobs to that location. Or simply you can term it as location database.

Please note that the Job location can be anywhere like cities/states. Does Toolset map help here or I need to take a different approach?

Please help me out of this situation. Thanks.

#1290315

Sorry, my internet connection was down, so I couldn't continue. I appreciate your suggestion. But the problem is a job location can be anything like it can be a small town or a district or a state and interestingly they are connected hierarchically. Like Country>> State>>District>>Place.

Now how to create this type of relationship between the locations. By creating multiple post types for States and Districts etc.?

Another problem is- so far I know a relationship can be created between two posts and not within the RFG (used for job description) within the post and location. Hope you got my point.

Now, what would you suggest?

#1290319

Waqar
Supporter

Languages: English (English )

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

Hi there,

Thanks for writing back.

> Now how to create this type of relationship between the locations.
> By creating multiple post types for States and Districts etc.?

- Your understanding is correct and this is how these will be structured:

a). Country post type will have a one-to-many relationship with the State post type.
b). State post type will have a one-to-many relationship with the District post type.
c). District post type will have a one-to-many relationship with the Place post type.
d). Place post type will have a one-to-many relationship with the "Job" post type.

Once a job post will be connected to a place, it will naturally have an indirect connection with the upper-level post types, in the hierarchy.

> Another problem is- so far I know a relationship can be created
> between two posts and not within the RFG (used for job description)
> within the post and location.

- This won't be a problem since through the RFG, you already have a hidden relationship between a Job post and the job descriptions attached to it.

When you'll have the ID of the Job post, you can easily show its associated job descriptions.
( ref: https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups )

Again, a place doesn't need a direct relationship with a job description, since these three will be already indirectly linked together.
Place -> Job ->> Job description

I hope this clarifies and please let me know if you need any further assistance around this.

regards,
Waqar

#1290327

Well, your explanation tells most of the story. Let me clarify a few things like:

there are possibilities where a type of job position can have multiple job locations associated with it, in that case, a common job location for a 'job post' won't work.

Hence, let me clarify a 'post reference field' in the RFG with job location will work? And how a post reference is different from post relationship?

Thanks for your support.

#1290377

Waqar
Supporter

Languages: English (English )

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

Hi,

Thank you for sharing further details.

The requirement of one job having multiple places/locations changes things.

A post reference field can't be placed inside a repeatable field group. Even if through some workaround we're able to store the ID of the "Place" post type, with each repeating field group entry (Job description), it won't help in making it search filter friendly (e.g. filtering jobs based on a location or showing similar jobs, based on a location). Hence this is not what I'll recommend in this particular case.

If a single job post can have multiple locations (and possibly other fields and description) it would make sense to add them as a separate job post, instead of using a single job post, with a repeatable field group. For example:

- Example Job Title ( location 1 )
- Example Job Title ( location 2 )

This approach will keep the jobs, search filter friendly overcoming the limitations, mentioned above. You'll find a similar approach in use, on multiple job directories and portals.

A post reference field merely stores the ID of the selected post, as a custom field value and this is, therefore, a one-way connection.

However, the connection made through post-relationships ( ref: https://toolset.com/documentation/post-relationships/ ) is two-way and more complex and therefore allows more operations.
( you can read this post for more background information: https://toolset.com/2016/08/how-post-relationship-replaces-post-reference-and-repeating-fields/ )

regards,
Waqar

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