Skip Navigation

[Closed] Fetching ACF "Relation" Fields (array)

This support ticket is created 11 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by Nicklas 11 years, 10 months ago.

Author
Posts
#2714

Hi Amir, hi folks,

great plugin so far, thanks! I am trying to build a view based on the following construct:

- custom type: widget
- custom type has custom field (not your plugin but via ACF): "similar widgets" (a "Relation" object)

So I already tried building a view template for displaying single "similar widgets", but I am not able to access them from the main view. The main view is outputting the "array" of similarWidgetIDs ("2,6,27").

1) Is there any simple way to have the way loop through this array and display the "similar widgets" for each widget?

2) Alternatively, any plans to implement the "Relation" equivalent in your own "Types" plugin, so it can be integrated easier with views? I think it's a very frequent use case across all verticals (real-estate, blogs, review sites whatever....)

Thanks much
Nick

#2734

1) There is no simple way to do this. If you know PHP you can add a filter for when views displays a field with the wpv-post-field shortcode.

Views calls the filter

    $out = apply_filters('wpv-post-field-' . $name, $out, $meta);

2) We're adding relationships to Views/Types. It's still a few weeks before we will have it ready. You can read about the discussion here - https://toolset.com/2011/12/repeater-fields-for-types-and-views/

#2736

Thanks, Bruce. I may just resort to adding the view manually in PHP until it's part of Types+Views. Looks like you guys already have a good solution in the works there.

The topic ‘[Closed] Fetching ACF "Relation" Fields (array)’ is closed to new replies.