Skip Navigation

[Resolved] Displaying a field value in a related custom post type view

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

Problem:

Display post information in Repeatable field groups loop.

Solution:

Toolset Repeatable field groups are based on one-to-many relationship, the relationship slug is Repeatable field group slug, so each item of RFG is also a post, in the item of RFG you can display it's parent post information using types shortcode + "item" attribute, for example:

[types field="walk-in-interview" item="@RFG-SLUG.parent"][/types]

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

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.

This topic contains 2 replies, has 2 voices.

Last updated by deepS 2 months, 2 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#1688939

There are two types of custom posts: Companies and Jobs (they are related in one to many way). I often display field values of one in another.
There is a custom field in Jobs called 'Walk-in-Interview' (radio button) in Job post type. It shows whether the job is a walk-in-interview or not.
There is another view called 'Company Job vacancies' created to show the jobs available under the current company and it picks up the RFG values from job posts.
Now what I want to do is to display the walk-in-interview tags (from Job posts) against those vacancies (generated by Company Job Vacancies)
For understanding the things, please see the following URLs:
(job post) hidden link
(company post) hidden link

I am ready to share login information for the purpose.

#1689545

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

Toolset Repeatable field groups are based on one-to-many relationship, the relationship slug is Repeatable field group slug, so each item of RFG is also a post, in the item of RFG you can display it's parent post information using types shortcode + "item" attribute, for example:

[types field="walk-in-interview" item="@RFG-SLUG.parent"][/types]

Please replace walk-in-interview with your "walk-in-interview" field slug, replace RFG-SLUG with Repeatable field group slug

More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

I have enabled the private message box, in case you need more assistance for it.

#1689693

My issue is resolved now. Thank you!