This support ticket is created Il y a 3 années et 6 mois. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
In my camera issue view (&view_id=7445) I have a column that displays the location of the camera which is related to the title of the camera in the first column. IOW, in the issue form, the user selects a camera and that camera has a location that it is related to already.
So we are dealing with 3 CPTs (Cameras) (Camera Issues) (TMNA Locations).
The location (TMNA Location) is related to a (Camera).
A (Camera Issue) is related to a (Camera),
However, I cannot get the location of the camera to display in my view of issues. I've tried every type of post relationship for the (TMNA Location) field I can think of and it won't show up. I have to be doing this wrong. How do I get the related location to show up automatically for the selected camera for the (post) issue in the view?
I assume we are talking about three post types:
- Cameras
- Camera Issues
- TMNA Locations
One-to-many relationship between Cameras and Camera Issues
One-to-many relationship between Camera Issues and TMNA Locations
If it is, it needs a nested view, for example:
1) Parent post view
- Query Camera Issues posts
- Filter by relationship between Cameras and Camera Issues
- In view's loop, display below child post view
2) Child post view
- Query TMNA Locations posts
- Filter by relationship between Camera Issues and TMNA Locations
- In view's loop, display TMNA Locations post information
In single Cameras post content, display the Parent post view, and test again.
Yes, you are right, in your case:
One "Camera post" can connect with multiple "Camera Issues" posts
One "Camera Issue" post can connect with multiple "TMNA Locations" posts
So you can try the same steps as I mentioned above.
Please provide a test site with the same problem, fill your website credentials in below private message box, also point out the problem page URLs and view URLs, I need to test and debug it in a live website, thanks
Thanks for the details, I can login your website, and have done below modifications in your website:
1) Edit the child post view "Camera Related Location" hidden link
In section "Content Selection", enable only post type: TMNA Locations
in section "Query Filter", change the filter to:
Select posts in a Camera Issues TMNA Locations relationship that are a related to the current post in the loop.
2) Edit one "Camera Issue" post: hidden link
in section "Camera Issues TMNA Locations", connect one existed "TMNA Location":
3) Test it in front-end: hidden link
It works fine, can you confirm it? thanks
Well, you are correct that it does work the way you set it up. But that isn't exactly what I had in mind.
The hierarchy of relationships is as follows: tmna location>camera>camera issues. Therefore when a camera issue is created and the user selects a camera, the location is already linked to the camera. So that location should be retrieved from the same place. IOW, we have:
The Camera Issue linked to a Camera which is linked to a tmna location(s). My goal is to eliminate the location field from the camera issue form altogether since we already know the location of the camera (as it's already linked in the database).
There are lots of post type relationships in your website, some of them are duplicated or useless, for example:
Camera Issues Cameras: hidden link
Cameras Camera Issues hidden link
Please point out the correct relationships for you mentioned above: The hierarchy of relationships is as follows: tmna location>camera>camera issues
Which post type relationship is for "tmna location>camera"
Which one is for for "camera>camera issues"
To avoid more misunderstandings, please elaborate the questions with more details
Sorry, I guess I didn't understand your original question.
The hierarchy is as follows:
TMNA Location> Cameras > Camera Issues
Each Camera is mapped to a TMNA Location so (in theory) when a Camera Issue is entered an a Camera is selected the location should appear automatically because it's related to the Camera.
Camera is related to one (or more) TMNA Locations. camera-tmna-location
Camera is related to one (or more) Camera Issues. camera-camera-issue