Hi guys, I am trying to see if there is a way to pull back fields in a Repeater Field Group from one CPT (e.g. Widget CPT) from another relationship-connected CPT (e.g. Widget FAQs)?
I have all of the RFG fields and values in the Widget CPT, but rather than re-creating them in the FAQs CPT, I just want to see if there is a way to modify the existing View to pull back the same values when I am in a linked FAQs CPT.
Illustrative Example: hidden link
Page with original RFG info: hidden link
Page I want to show the same info: hidden link
In order to assist better I will need admin access, however it should be a case where you can manually pass the ID of the of the software two minute page that is getting the repeatable fields.
However it may be a case where you will need to create a copy view, but I will need to do a thorough walkthrough of the site.
I've enabled the private fields for your next response.
Thanks,
Shane
Thank you for the video. It helped a bit however i'm still having a bit of difficulties locating the view from the screenshot.
The view that should be listing out the price card. From your video it says this view below. hidden link
However checking the view itself, it doesn't have any code that would generate this output. If you could send me a direct backend link to the view I can definitely assist better.
No worries (actually locating Views was one of the issues I mentioned earlier, ha. I will create a thread for it.)
Re: attachment - So, the data field you see on the template frontend is actually connected to a custom field on the Software CPT backend, and not directly to a Toolset View. In the field, is a shortcode calling an Oxygen template.
This shortcode ties to the Template ID - accessible here: hidden link
Inside this template are the below Views. 🙂 If you open the "Structure" panel (top right), I've named all of the Views to start with "TV."
So, depending on the situation, I can call different templates based on need, which is why I built it this way.
I've added some markers to help you better understand where the Views are, and how they're tied together. Please let me know if you have any questions! Thank you.
Page with original RFG info: hidden link
Location: hidden link
View: hidden link
^ This is a View with nested bullets, but essentially if a View like this could be displayed across the linked CPTs, then the other ones should be able to follow suit. hidden link
Ok so i've found both view hidden link
and hidden link
As well as hidden link
From these 3 views you see that they are getting their parent information from the current page because of the filter that was selected "The post where this View is shown"
What you need to do is to duplicate these 3 views by going to Toolset -> Views and clicking the duplicate button. Then editing the filters on these views by selecting the option "The post with ID set by the shortcode attribute "
Then you will need to add the view to your template using the view's shortcode. E.g
Where you can see i've added the view's slug as well as the id of this page below. hidden link
So on your FAQ page it will cause the view to pull the data from the two minute reports. So this is the modification that is needed for any other view that is pulling data on the FAQ page.
Duplicate them and then change the filters to get the value from a shortcode parameter.
With the ID set to '55', doesn't that mean the solution will only work for that specific ID? How could we get this to work so that this solution can be applied to any/all other CPTs that are dynamically related?
I will re-read this and see if I can implement it, but it sounds like this would be a one-off solution, rather than a dynamic one that would work across other Software records?
I had a look at the FAQ and seems that it is indeed related to the software.
In this case you can disregard my previous instructions but not entirely, you will still need to create the duplicates for each of the views, however you will now need to create a Parent View.
Here is what you will need to do in short.
1. Create a Parent view that will list the Software CPT.
2. Add a Post Relationship query filter to that Parent View and select "The post where this View is shown"
3. Now create duplicates of the views that are already listing out the data on the Software pages.
4. On each of those duplicates you will need to change the filter from "The post where this View is shown" to "The current post in the loop" See Screenshot.
5. Now add this duplicate to the Parent View ensuring that it is within the <wpv-loop> tags, and nothing else needs to be added to this view.
6. Add the parent view to the FAQ page.
Now what this is doing is getting the information of the software page through the post relationship. Please let me know if this is clear as it should produce the dynamic results that you desire.
Thank you! This worked perfectly. One small thing I couldn't figure out.
For the duplicated Views in step #3, I changed it to "The Current Post in the Loop", but the View which I duplicated it from has an 'item' attribute that refers it to $current_page.
Previously, since it was filtered on "Post where this View is shown", the loop would break out of the Repeater Field Group and pull back from that Custom Field and that worked great.
But, this attribute no longer works since it is in the Current Loop. I tried to modify it by changing it to $parent, ${relationship-slug}.parent, ${relationship-slug}.child just to test it out, but none of it seem to have worked.
Would you have any thoughts on how to pull back that Custom Field from the Software CPT outside of the Repeater Field Group?