Skip Navigation

[Resolved] Display a Relationship connected Repeater Field Group from another CPT

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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by saint 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1932529

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

#1934197

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Saint,

Thank you for getting in touch.

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

#1935351

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Sain,

It would be best to open these ticket as a separate issue given that you've grouped them.

Also i'm not familiar with the Oxygen builder. Can you send a short guide on how the view was added to the page.

I suspect that you will need to just duplicate this parent view and manually pass the ID of the parent into it using the shortcode attribute.

Once you've duplicated the parent view you perhaps won't need to do anything else besides selecting where the parent filter gets its data from.

Thanks,
Shane

#1935447

Hi Shane,

Sure, no problem! Here is a quick guide from the official Oxygen site on how they integrate Toolset Views into Oxygen:

hidden link

I also made a quick walkthrough for you here: hidden link

> just duplicate this parent view and manually pass the ID of the parent into it using the shortcode attribute.

Apologies, I am not sure what you mean - how would I go about doing that? Would love to see if this works, thank you!

#1935707

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-02-05 at 2.14.34 PM.png

Hi Saint,

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.

Thanks,
Shane

#1935757

Hi Shane,

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

Page I want to show the same info: hidden link

#1938653

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Saint,

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

[wpv-view name='field-list-price-tier-1-from-software-cpt-related-to-inserted-view' wpvrelatedto='55']

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.

Please let me know if this helps.

Thanks,
Shane

#1938661

Hi Shane,

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?

Thank you!

#1938687

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-02-08 at 4.33.10 PM.png

Hi Saint,

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.

Thanks,
Shane

#1958903

Hi Shane,

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.

[types field="unit-of-time-base-duration" item="$current_page"][/types]

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?