Hi, I am making one job website with post types 'Jobs' and 'Companies'. I have created a 'one to many' relationship between the Company (parent) and Jobs (child).
The job type post also includes Repeatable Group of Fields about vacancy details. Well, they are perfectly showing up in the Job posts.
But I want to show those Repeatable Group Fields in the parent post i.e. Companies.
Now my question is whether it is possible to show such data (repeatable fields of child post in parent post) in one to many relationship?
How can I achieve this? Please help.
Hi, you can use a nested View structure to achieve this.
- Create a View of the RFG, filtered by RFG owner Job, where the owner Job is set by the current post in the loop.
- In the Loop, display the information from the RFG.
- Next create a View of Jobs filtered by post relationship, where the parent Company is set by the current post or current page being displayed.
- In the Loop of the View of Jobs, insert the View of RFG you just created.
- Insert the View of Jobs in the template for Company posts.
Well for the first part I have created a view of the RFG. But I could not execute the second part as I am confused.
I am attaching here the screenshot_4 for creating the second view. See whether things are ok? In the screenshot_5 I have added the RFG view. But things are not working.
Please help me in a detailed way.
Screenshot 4 looks good, but I can't quite see everything in screenshot 5. May I log in and see how it's set up? Please provide login credentials in the private reply fields here.
I made two changes:
1. In the Job Vacancy Details View - in the Content Selection editor, I unchecked "Jobs". The results here should be RFGs not Jobs.
2. Job Vacancy Details View - edit the Query Filter to respond to the current post in the loop. It was previously set up to respond to the post where the view is shown.
Thanks for your support. You are awesome. Sorry to bother you a bit more.
Can I show the value of a custom field (like the Last Date of Application) in a Job post in the RFG (i.e. Job Details) individually for every entry? And also a Read more button targeting towards the job post where the job detail is residing.
Can I show the value of a custom field (like the Last Date of Application) in a Job post in the RFG (i.e. Job Details) individually for every entry?
You want to show a field from the parent Job post, in the View of RFG? Sure, in the RFG View click "Fields and Views" and then click the field you want to display. Use the "Post Selection" tab in the popup to select the parent Job post.
And also a Read more button targeting towards the job post where the job detail is residing.
Same thing here, you will use the Fields and Views button in the View of RFGs to insert a post link shortcode. Use the "Post selection" tab to select the parent Job post.
See the screenshot_6 generated after the points suggested by you in the last reply. You can see the issues in the screenshot.
Here is the code I have used in 'Short Job Vacancy' (I used in the template) view:
<h4>[types field="post-name"][/types]</h4>
<p>No. of Vacancies: [types field="no-of-vacancies"][/types]</p>
<p>Last Date of Application: [types field='last-date-of-application' style='text' format='F j, Y' item='@company-job.parent'][/types]</p>
[wpv-post-read-more]
<hr>
Hope you can view the things through the log in credentials provided to you. Thanks for your support.
It looks like you selected the company-job relationship instead of the job post details relationship for the last date of application, and the wpv-post-read-more should include the same item attribute:
<p>Last Date of Application: [types field='last-date-of-application' style='text' format='F j, Y' item='@job-post-details.parent'][/types]</p>
[wpv-post-read-more item='@job-post-details.parent']
I made those changes for you, please check now.
You are too good. I cannot express in words how brilliant support you extended to me. I was really unware about how to setup relationship even between the fields. Thanks for your valued information.
One last help I required in this regard: I want to order those entries according to the last date of application rather than the post date in 'Short Job Vacancy' view. Actually, I tried arranging the entries according to the last date of application, but it's showing no result.
Hence I am asking for support. Hope I am not irritating you. Thanks.
I want to order those entries according to the last date of application rather than the post date in 'Short Job Vacancy' view
All these items will have the same last date of application, because the last date of application is on the parent job post. They all have the same parent. If you want to order the View of Jobs by last date of application, you would have to add the custom field ordering in the Job in Company View: hidden link
"If you want to order the View of Jobs by last date of application, you would have to add the custom field ordering in the Job in Company View: hidden link"- I couldn't understand.
Are you talking about adding a custom field for 'Last date of Application' in the RFG? If that's your point then I understand.
If I am getting you correct then please let me confirm whether is there any option where I put the 'Last Date of Application' (the parent job post) only once and it replicates the same in the custom fields of RFG in the background (through conditions or something like that)?
Hope you understand my point. Thanks
Not quite, I'm saying you should edit the View here:
hidden link
Scroll down to the Ordering section. This is where you would order by the custom field Last Date of Application.
My issue is resolved now. Thank you!