Skip Navigation

[Resolved] Many to Many without Mediary

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 11 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 10 replies, has 3 voices.

Last updated by stevej 11 years, 1 month ago.

Assisted by: Caridad.

Author
Posts
#61396

I am creating a physician directory. It will consist of physicians and locations. What I would like to do is when I create a physician, at the bottom it lists all the locations with check boxes next to each on. I could check the box for each location that physician is associated with. Can I do this without creating the Third mediary custom post type?

It seems to me rather clunky to create Physicians, Locations, and then have to create another custom post type 'Physician and Location Joins' where I associate each physician with their locations, one at a time. Am I missing something?

#61398

So, ok, let me talk this out and you guys correct me where I am missing something. I have created two custom post types.

Physicians
Locations

For physicians, I have created a few custom fields.

Name
Title
Prefix
Suffix

For locations, I have created some custom fields also.

Address1
Address2
City
State
Zip
Phone

I have created a couple Physicians, and a couple locations

I have designated Locations to the CHILD of Physicians.

So now when I am editing a Physician, at the bottom, I have an area called "Fields Table" and it says 'Locations' like I expected it to

However, there are no Locations listed I can select. But there is the ability for me to ADD NEW LOCATION... But I need to be able to simple select from the locations that already exist.

What am I doing wrong?

#61401

I think I finally understand the parent/child thing and I see now that I would not want to make a physician a parent of a location. A location will need to have lots of physicians associated with it, not just one.

What I would love to be able to do is the edit a physician and be presented with a list of locations currently in the system, and I could select one or more of them and/or add a new location right there... Maybe that is the Holy Grail but that is the functionality I need.

Any thoughts?

#61403

I need to be able to query a Physician and get a list of locations.

I need to be able to query a Location and get a list of physicians...

#62008

Dear Steven,

With the functionality you expect from Locations I would recommend you to use a custom taxonomy instead. But you cant add custom fields to a taxonomy.

One solution could be to use the description field of each term in a taxonomy, and fill in the address there.

There are also other plugins that will allow you to add fields to a taxonomy:
http://wordpress.org/extend/plugins/taxonomy-meta/

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad

#62157

Well, hmmm... Yeah I need to be able to separate out Address1, Address2, City, State, Zip... I would need to be able to modify the results based on any of these fields...

So, to clarify, there is no way to have a one-to-many relationship between two custom post types?

#62202

Dear Steven,

Yes, there is. You mentioned it yourself, using an intermediary taxonomy or an intermediary custom post type:
https://toolset.com/faq/how-do-i-associate-one-child-with-several-parents-of-the-same-type/

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad

#62223

I have decided that taking Types and then using ZigConnect plugin to maintain the relationships provides we with exactly what I was looking for. Thank you for your help...

#75754

SteveD, this is exaclty what i'm trying to do, how did you get on with ZigConnect ? as i see its a little out of data does it work ok with wordpress 3.5 ?

#75762

stevenD: I just installed zigConnect, looks great in the admin, - do you have any tips for displaying those relationships Zigconnect created? . . thanks stevie

#75764

just to add i found this http://wordpress.org/extend/plugins/posts-to-posts/ seems to be updated and some extra features.. might give that a go.. did you see that before?

The forum ‘Types Community Support’ is closed to new topics and replies.

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