Skip Navigation

[Resolved] I would like to set up a one to one relationship.

This thread is resolved. Here is a description of the problem and solution.

Problem:
The issue here is that the customer wanted to setup a one to one relationship between his posts.

Solution:
To setup a post relationship please take a look at the documentation below.
https://toolset.com/documentation/user-guides/creating-post-type-relationships/#creating-a-post-relationship

This support ticket is created 6 years, 10 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 9 replies, has 2 voices.

Last updated by felixP-3 6 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#623425

Tell us what you are trying to do?

I would like to set up a one to one relationships. ie: Organization->Address; Person->Address; Store->Address.

I would like to print to the screen listing all posts Organization, Person, Store etc followed by their respective address

Is there any documentation that you are following?

Toolset post relationship tutorial. If you could give me an example, that would be great.

Is there a similar example that we can see? I think it is similar to your many-to-many relationship tutorial, but I can't figure it out.

What is the link to your site? It is a local site.

#623463

Shane
Supporter

Languages: English (English )

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

Hi Felix,

Thank you for contacting our support forum.

I'm not sure if you took a look on the documentation here.
https://toolset.com/documentation/user-guides/creating-post-type-relationships/#creating-a-post-relationship

But what you can do is on each of the post types Organization, Persons, Store you can go to there settings page and set Address to be their child CPT.

This should create the relationship for you.

Please let me know if this helps
Thanks,
Shane

#623508

I did that, but I don't know how to display the data in a table form.

For example :

Organization Name Address of organization
Store Name Address of store
Person's Name Address of person

How do you loop through these?

#623704

Shane
Supporter

Languages: English (English )

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

Hi Felix,

Are these going to be on separate pages ? Or are they listed out on a single page.

Could you show me an example page where you want the address to show up so that I can best advise?

Thanks,
Shane

#623719

They will be listed on a single page in a table form.

Here is an example of what I want it to look like.

I would like to keep Organizations, Stores, and Persons in separate post types but use one address post type to store all the addresses for all the Organization ,Store, and Person post types. IS THIS POSSIBLE? Thanks.

Column 1 - Name Column 2 - Address
----------------------------------------------------------------------------------------
Organization 1 Address of Organization 1
Store 1 Address of Store 1
Store 2 Address of Store 2
Person 1 Address of Person 1
Person 2 Address of Person 2

#623724

Shane
Supporter

Languages: English (English )

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

Hi Felix,

Ahh yes this this is possible.

So what you need to do is to create your first view that list the Parent Posts .
It will list your Organizations, Stores and Persons.

Then you create a child view that will list the child cpt Address and add a filter for the post relationship as you can see from our documentation below.
https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/#displaying-child-posts-using-views

Finally you will add this child view into your parent view so that it can list out the appropriate address.

Please let me know if this helps or if you need further clarification.

Thanks,
Shane

#623785

I wish there was an option saying "I may need more help".

I got it working, I need to do some more testing. Can you keep this ticket open until March 12th at 5pm EST just in case I run into any problems. Thanks.

#623794

Shane
Supporter

Languages: English (English )

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

Hi Felix,

I dont suspect that you will run into any issues but if you do the ticket will be here and you can just respond to get my attention for further assistance.

If the issue has been resolved after your testing please mark this ticket as resolved so that it can be in our resolved ticket pool to aid other customers.

Thanks,
Shane

#623892

deleted

#623901

The problem has been solved, thanks.