Skip Navigation

[Resolved] Custom Field for an Intermediary Post is not Displaying in View

This support ticket is created 3 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by nedG 3 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1661253
Attachment-D.jpg
Attachment-C.jpg
Attachment-B.jpg
Attachment-A.jpg

I have FOOD TRUCKS that arrive at a specific (static) location on each day of the year. I want to set up a view the displays what FOOD TRUCKS will be at that location so visitors can know when to expect the FOOD TRUCKS. I wanted a nice calendar view.. but I will have to wait until you are done developing that, So I went with a list view.

So, I have set up a many-to-many relationship. I guess I could have set up a one-to-many relationship, but I wanted a little more flexibility.

Parent CPT: FOOD TRUCKS
(these are simply the names of the Food Trucks as the CPT title. No other custom fields)

Child CPT: FOOD TRUCK DATES
(These are the dates that the Food Trucks will be at that location. To make it easier on my client, I imported a CSV file of every day of the year.. January 1, January 2, January 3, etc... so my client could easily see the titles then and I created a date as a Custom Field. For convenience and organizing purposes I instructed the client to be sure to choose the custom field date as the same as the title)

Intermediary CPT: FOOD TRUCKS FOOD TRUCK DATES INTERMEDIARY POSTS
I created a single text custom field called FOOD TRUCK HOURS here so that my client could manually type the hours that the FOOD TRUCK would be at the location... For example... 4pm-9pm) See Attachment A

NOTE: I decided not to use the Date-Time Custom Field because it would have required a lot of "clicking and selecting" in order to select the start date and start time and the end date and end time. I just wanted it to be easy for my client... so selecting a single date and manually typing a start-end time in a single text field seemed simpler. If you have another suggestion, I am open to it.

Anyway... after establishing all of the above, I created a View that queried all Food Truck Dates in ascending order by the Food Truck Date custom field and also filtered by only FOOD TRUCK DATES greater than or equal to TODAY().
Then I created my display. I wanted to display
1) The Parent (FOOD TRUCK) Featured Image and Title
2) The Child (FOOD TRUCK DATE)... Date Custom Field
3) The Intermediary Post (FOOD TRUCKS FOOD TRUCK DATES INTERMEDIARY POSTS)... Food Truck Hours Custom Field.

Everything seems to work... except that I cannot get the Food Truck Hours custom field for the FOOD TRUCKS FOOD TRUCK DATES INTERMEDIARY POSTS to display. I have attached my View so you can see. Attachment B

I have also attached the Fields and View selection window that I used to create the shortcode. Attachment C

For some reason, the Food Truck Hours for the Intermediary Post does not display. I can't figure out what I have done wrong and why it won't display.
See Attachment D

#1661295

After posting this support request, i actually found my solution. In my View, I needed to use the following shortcode...

[types field='food-truck-hours' item='@food-truck-food-truck-date.association'][/types]

instead of

[types field='food-truck-hours' item='@food-truck-food-truck-date.intermediary'][/types]

I had to do it manually. Why didn't your Types and Fields selector insert the proper shortcode?

#1662723

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Glad to know that you found the solution and yes, you found the correct solution and correct way to display the intermediary post type custom field. The shortcode you are using is correct.

Please feel free to close the ticket.

#1663523

Why didn't your Types and Fields selector insert the proper shortcode?

#1663553

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

It should generate the correct shortcode. Can you please tell me where exactly you see this issue. If you can share access I would be happy to look at it.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1663591

I actually changed my relationship from many-to-many to one-to-many, so there is no longer an intermediary post. So you can't see the issue.
If you create an intermediary post and follow through the steps as outlined in my screenshots, you should be able to see it.

I could never get the proper shortcode generated...
[types field='food-truck-hours' item='@food-truck-food-truck-date.association'][/types]

The only way I got it was becasue I researched the forum.

#1663593

My issue is resolved now. Thank you!

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