Hi,
I have set up a one-to-many relationship between two posts type (in your examples Airports and Flights, not Toolset types) and it works fine. But in order to make it work I had to enter a parent (airport) value in Flights posts manually, as explained in your tutorial.
Entering parent/link values manually for me is an issue because I load hundreds of posts in Flights via XML file. In the load process I also load the Airport_ID that could be used to link the two post types, but as far as I understand Toolset relationships are stored in a different relationship post type that needs to be loaded separately. Is there any way to set relationship=Airport_ID field directly in the view ? or should I load via XML also the relationship post type ? how ?
thanks regards
Hi Shane,
thanks for your indications, now I understand how it works. Basically you are confirming that there isn't other way than to load the relationship. What really surprises me is that in the documentation above is shown that Toolset works loading descriptions instead of IDs ! in the last picture, what if you had 2,3,4 .... Sandy Hought ? which one would be loaded ? or one could work with IDs too ?
thanks
Regards
Nicola
Hi Shane,
I've been thinking about this and it seems quite weird to me that to maintain a relationship I need to buy a 100$ plugin and install an add-on that is still labelled Beta! All this just to duplicate an information that I already have in the "many" post type. Actually in the documentation is said "Instead of the post title, you can also use the post slug or id" but I cannot figure out how: when it comes to selecting posts, one can just select the custom post types to be linked, but not the fields. Also, when I am into one child post, I can maintain the relationship manually entering the parent value, that is taken from the parent descriptions list, no way to use another field. I'll give you my situation
Parent post type = Shops
[ShopID]
Shop name
Shop description
Shop latitude
Shop longitude
:
-----------------
Child post type = Discounted deals
[DealID]
Deal title
Deal description
ShopID
:
In the deals post type I already have the ShopID (loaded via XML) but when I define a relationship in Toolset I'd need to select the Shop name in the relationship while I could use the ShopID that is already there. This method could be acceptable for loading info into a many-to-many, but for a one-to-many is redundant. Am I wrong or am I missing or misunderstood anything ? is there a way to use the ShopID instead ? thanks regards
You can see the column Speaker in the Presentation table. Speaker would be the Slug of the parent CPT and then under each presentation you can add the ID of the parent instead of the post title, this is how you would use the ID instead of the post title.
So in your case where the Shop is the parent and Discount deals is the child, you will have in your Discount Deals table a column for Shop where you will add the ID of the shop. So It must be the Shops post type slug being the name of the column.
If you can send me a sample screenshot of your data I can have a look to see if anything is wrong.
Hi Shane,
I am not sure if the attached screenshot would help you, hope so.
As far as I understand you are suggesting me to relate the slugs instead of the IDs. To me it would be ok but also in that case I'd need to load the Store slug value in the Offers table. What I need is NOT to load a new field if I can use an already existing field! This is what I am asking you for: how to relate the IDs in the screenshot without being forced to LOAD the Store name in the relationship ? Loading a one-to-many relationship it makes no sense also because I could simply create a new Store_Name field in the Offer table and load the store name into that (flat table), no need for a relationship !
Thanks
Regards